[ $davids.sh ] — david shekunts blog

🏚 -> Want a scalable system? -> 🏰

# [ $davids.sh ] · message #11

🏚 -> Want a scalable system? -> 🏰

Systems consist of:

. Knowledge – some set of composed data reflecting the state of a concept/object (“Order” in an online store)

. Actions – actions performed on Knowledge, most often CRUD (“get a list of Orders”) or a more complex set of actions that perform multiple CRUD (“place an Order”)

. Events – data notifying about facts (always a verb and always in the past tense) that occurred in the system over Knowledge during Actions (when placing an order: “order status changed”, “delivery invoice generated”, “payment made”, etc.)

If the first two concepts are present in any program, the third one is often forgotten, but it's no less (and often more) important!

After all, Events allow:

  1. Breaking the system into small independent pieces, responding to each other's events

  2. Extending functionality, creating systems that respond to events, without rewriting existing code

  3. Knowing the system's state in the past (or at least the flow of events), which makes debugging easier

  4. etc.

This now applies not only to backend or frontend, but you can even write libraries this way

To learn about working with Events, google:

. DDD Domain and Application Events . Event Driven Architecture . Saga pattern . Orchestration vs Choreography

Or put up 15 classes (👌), and I'll do a workshop on this topic

———