Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rajp152k committed Jul 18, 2024
1 parent ce95468 commit dd29cbf
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 10 deletions.
13 changes: 6 additions & 7 deletions Content/20230717155414-event_based_programming.org
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
#+title: Event Driven Programming
#+filetags: :programming:

This principle paradigm used in Graphical User Interfaces (eg, upon click/submit, etc) and in cases when one uses triggers related to an event rather than querying to verify if that event happened.
* Abstract

In the generic structure of the driver, we have a main loop (aka listener instead of an asker in the conventional verification solution) that acts(executes hooks/callbacks) when certain events are triggered.
The event-driven paradigm is readily observable in graphical user interfaces (GUIs) where actions like clicks and submissions trigger specific responses. This contrasts with traditional verification-based systems that rely on continuous polling.

This may even be implemented by hardware interrupts in the case of embedded systems.
Event-driven architecture centers around a main loop (often termed a "listener") which remains dormant until an event occurs. Upon triggering, the listener executes pre-defined functions known as event handlers, hooks, or callbacks. This mechanism can be implemented at the hardware level using interrupts, particularly in embedded systems.

Any procedure one executes post an event may be termed as an event-handler/hook/callback.
Higher-level programming languages offer abstractions for elegant event handling. Asynchronous programming constructs like "await" (often paired with "async") and closures (also known as lambdas) streamline event-driven code.

Segue into the higher level programming abstractions of await(coupled with async) and closures (colloquially lambdas).

Exploring the practical component via [[id:c9704c39-0c34-40af-b7f7-973cdd03cb05][Async-IO-python]]
* Practical
- [[id:c9704c39-0c34-40af-b7f7-973cdd03cb05][Async-IO(python)]]
2 changes: 1 addition & 1 deletion Content/20230717162602-asynchronous_programming.org
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#+title: Asynchronous Programming
#+filetags: :programming:

* Instantial
* Language Specific
- [[id:c9704c39-0c34-40af-b7f7-973cdd03cb05][Async-IO(python)]]

1 change: 1 addition & 0 deletions Content/20231228155354-big_data.org
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
#+title: Big Data
#+filetags: :data:

check out [[id:ee0b0178-82f7-4fd2-af51-f6378f251c9e][The Modern Data Stack]]
1 change: 0 additions & 1 deletion Content/20240215121114-docker.org
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- TLDR : Cgroups and kernel namespaces
- https://container.training/intro-selfpaced.yml.html#679


* Misc QuickRefs
- to avoid uneccessary duplication, docker employs the [[id:61ba02ce-df71-40c8-ac61-0762c4130345][copy-on-write]]
- diff between docker build, import, commit
Expand Down
2 changes: 2 additions & 0 deletions Content/20240423103725-message_passing_computation.org
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
#+filetags: :programming:

A foundational thinking approach that enables [[id:20231212T081851.998455][Object Oriented Programming]] and [[id:618d0535-411d-4c36-b176-84413ec8bfc1][Concurrency]]([[id:3b44673f-5e7c-4b96-8ef2-1d68f5131173][Actor-Model Computation]])

In the context of scaling your operations, checkout
8 changes: 7 additions & 1 deletion Content/20240502085158-linux.org
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ tree -D -L 1 /
** Linux Security Modules (LSMs)
- checkout : https://www.starlab.io/blog/a-brief-tour-of-linux-security-modules
- also see : https://kubearmor.io/


** chroot
:PROPERTIES:
:ID: d922cae8-da0c-4a0e-8d78-d8e8358d502b
:END:
- checkout https://superuser.com/questions/111152/whats-the-proper-way-to-prepare-chroot-to-recover-a-broken-linux-installation

* Resources
- https://www.cherryservers.com/blog/a-complete-guide-to-understanding-linux-file-system-tree

5 changes: 5 additions & 0 deletions Content/20240717094915-rabbitmq.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:PROPERTIES:
:ID: 4a3714bb-42dd-4bdd-aa04-9b868aaee1df
:END:
#+title: RabbitMQ
#+filetags: :data:programming:tool:
49 changes: 49 additions & 0 deletions Content/20240717095231-message_brokers.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
:PROPERTIES:
:ID: 1073cfed-a09d-48b6-bd52-ba09708699bf
:END:
#+title: Message Brokers
#+filetags: :programming:tool:data:

* Why
- robustness and scalability require decoupled components
- message brokers act as [[id:b2ce2739-98c4-4ff0-931c-3a836686bf55][asynchronous]] intermediaries for interservice [[id:20240114T210106.876975][coms]]
- instead of direct, synchronous calls, applications exchange messages through the broker
- see [[id:46f09529-c273-49ed-9bf7-7e0a6d97d65c][Event Driven Programming]]

* Benefits of [[id:501f2afe-e1af-4284-9ac3-3e44f68af7c1][Indirection]]

- Decoupling: Producers and consumers operate independently, enabling asynchronous communication and enhancing [[id:20240519T162542.805560][fault tolerance]].

- Increased Performance & Responsiveness: Asynchronous messaging prevents producers from blocking, optimizing performance even under heavy load.

- Simplified Development & Deployment: Location transparency abstracts service discovery and routing complexities.

- Load Levelling: Message queues act as buffers, absorbing traffic spikes and preventing cascading failures.

- Reliable Delivery: Brokers offer various message persistence and acknowledgement options, ensuring message delivery even in failure scenarios.

* Characteristics

- Message Ordering: Guaranteed within a partition/queue, not across multiple. Impacts scalability and consistency.

- Delivery: "At-least-once" ensures delivery (potential duplicates). "Exactly-once" guarantees single processing (more complex). Choose based on use case needs.

- Durability: In-memory queues offer speed but risk data loss. Disk-based persistence prioritizes reliability over speed.

- Message Flow: Push-based brokers deliver messages proactively. Pull-based brokers require consumer action.

- Routing: Content, topic, or header-based routing mechanisms allow for granular control over message delivery and consumption.

* Tools
** [[id:4a3714bb-42dd-4bdd-aa04-9b868aaee1df][RabbitMQ]]
- Mature and versatile message broker.
- Robust routing capabilities with diverse exchange types and protocol support.
- Prioritizes flexible message delivery over raw throughput.
** [[id:fa58feb4-25a2-40f1-8533-cafcb0d3886b][Kafka]]
- High-throughput data streaming for event-driven architectures and real-time analytics.
- Guaranteed order within partitions and robust fault tolerance.
- Ideal for mission-critical applications.
** [[id:5e438030-0096-4b97-8931-f99eb7b738c5][Apache Pulsar]]
- Cloud-native platform combining queuing and streaming.
- Features multi-tenancy, geo-replication, and flexible subscription semantics.
- Versatile choice for distributed applications.
5 changes: 5 additions & 0 deletions Content/20240717100024-indirection.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:PROPERTIES:
:ID: 501f2afe-e1af-4284-9ac3-3e44f68af7c1
:END:
#+title: Indirection
#+filetags: :meta:
5 changes: 5 additions & 0 deletions Content/20240717101541-apache_pulsar.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:PROPERTIES:
:ID: 5e438030-0096-4b97-8931-f99eb7b738c5
:END:
#+title: Apache Pulsar
#+filetags: :tool:programming:data:
5 changes: 5 additions & 0 deletions Content/20240717104733-the_modern_data_stack.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:PROPERTIES:
:ID: ee0b0178-82f7-4fd2-af51-f6378f251c9e
:END:
#+title: The Modern Data Stack
#+filetags: :data:

0 comments on commit dd29cbf

Please sign in to comment.