Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 51 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{% include mathjax.html %}

This [repository](https://github.com/roikonen/scalablemodeling) offers a **modeling technique** for designing
**scalable systems**. Every new system should be designed with scalability in mind — **scalability is essential for
success**. With **Scalable Modeling**, you can embed
scalability in your system design from the start. Influenced by [Clean Architecture](#robert-c-martin),
[Event-Driven Architecture](#event-driven-architecture-eda) (EDA),
**scalable systems**. Any system aiming for growth should be designed with scalability in mind — **early consideration
of scalability is often essential for long-term success**. The best practice is to design in a way that **enables
future growth**, even if you're not scaling yet.

With **Scalable Modeling**, you can embed scalability into your system design from the beginning. Influenced by
[Clean Architecture](#robert-c-martin), [Event-Driven Architecture](#event-driven-architecture-eda) (EDA),
[Domain-Driven Design](#eric-evans) (DDD), [EventStorming](#alberto-brandolini), and
[CQRS](#command-query-responsibility-segregation-cqrs), this approach remains flexible and doesn't rigidly adhere to
any single methodology. That is why this **event-centric architectural approach** has different name:
[CEQS - Command-Event-Query Separation](#ceqs-command-event-query-separation).
[CQRS](#command-query-responsibility-segregation-cqrs), this approach remains flexible and avoids rigid adherence to
any one methodology. That’s why this **event-centric architectural approach** has a distinct name:
[CEQS – Command-Event-Query Separation](#ceqs-command-event-query-separation).

**Your implementation doesn’t need to scale from day one.** But when the model is designed with scalability in mind and
follows CEQS, the system can evolve — adapting to rising demands for resilience and responsiveness — so that **growth
becomes an advantage rather than a challenge**.


![](pictures/0_scalable_modeling_components.png)
_Justification for the red arrows in sections: [Queries](#queries) & [Time Travel](#time-travel)._
Expand All @@ -17,11 +24,12 @@ _Justification for the red arrows in sections: [Queries](#queries) & [Time Trave

# Change Log

| Version | Date | Changes Made |
|---------|------------|--------------------------------------------------------------|
| 0.1 | 2024-10-11 | Components of Distributed Systems Modeling (EDA & CQRS) |
| 1.0 | 2024-11-01 | Published: Scalable Modeling – An Event-centric Approach |
| 1.1 | 2025-01-24 | New section added: [Implementing Logic](#implementing-logic) |
| Version | Date | Changes Made |
|---------|------------|----------------------------------------------------------------------------------------|
| 0.1 | 2024-10-11 | Components of Distributed Systems Modeling (EDA & CQRS) |
| 1.0 | 2024-11-01 | Published: Scalable Modeling – An Event-centric Approach |
| 1.1 | 2025-01-24 | New section added: [Implementing Logic](#implementing-logic) |
| 1.2 | 2025-04-17 | New sub-section added: [Resilience and Responsiveness](#resilience-and-responsiveness) |

# Table of Content

Expand All @@ -37,6 +45,7 @@ _Justification for the red arrows in sections: [Queries](#queries) & [Time Trave
* [Why to Concentrate Domain Knowledge & Scalability](#why-to-concentrate-domain-knowledge--scalability)
* [Domain Knowledge is the Most Underrated Key to High Development Velocity and Quality](#domain-knowledge-is-the-most-underrated-key-to-high-development-velocity-and-quality)
* [Scalability is Prerequisite of Success](#scalability-is-prerequisite-of-success)
* [Resilience and Responsiveness](#resilience-and-responsiveness)
* [Scalable Modeling](#scalable-modeling)
* [Theory](#theory)
* [Event Centrism](#event-centrism)
Expand Down Expand Up @@ -214,6 +223,34 @@ those demands without sacrificing performance or creating technical debt.
Success isn’t just about growing fast — it’s about building the right foundation from the start, so that **growth
becomes an advantage rather than a challenge**.

### Resilience and Responsiveness

![](pictures/2_1_resilience_responsiveness.png)

Success demands systems that are both **resilient to failures** and **responsive at all times**. Both of these
qualities depend on **scalability** — especially in systems expected to grow.

- **Resilience** is the system’s ability to **recover from failures** and continue operating ideally without data loss
or service downtime.
- **Responsiveness** is about **how quickly a system reacts** to user actions or requests, maintaining consistent
performance under varying load. While **availability** is part of this, it's not the whole story — a system can be
“available” but still frustratingly slow. We’ve all stared at spinners. What we want isn’t just availability but
responsiveness.

A non-scalable system might perform well under low load but as usage grows, it can quickly become unresponsive or prone
to failure — directly undermining both resilience and responsiveness.

- **Scalability supports resilience** by allowing systems to redistribute load, isolate failures and add resources to
minimize the risk of total failure.
- **Scalability supports responsiveness** because it enables **elasticity***. When traffic spikes, an elastic system
can spin up additional application servers, database replicas and other resources. This prevents latency bottlenecks
and helps maintain fast, consistent response times even under pressure.

\*) **Elasticity** is the *runtime expression* of scalability — it’s the system’s ability to **automatically scale up
or down** in response to current demand.

With Scalable Modeling, models enable systems that are **resilient** and **responsive** by design.

# Scalable Modeling

![0_scalable_modeling_components.png](pictures/0_scalable_modeling_components.png)
Expand Down Expand Up @@ -259,8 +296,8 @@ of complex, high-demand systems.

[Scalable Modeling](https://roikonen.github.io/scalablemodeling/) does not go into purism in CQRS -
in [Scalable Modeling](https://roikonen.github.io/scalablemodeling/) queries can (when well justified) also query
command models for improved consistency where it does not jeopardise the scalability. Commands can also return simple
data like sequence number of the produced events.
command models for improved consistency where it does not jeopardize the scalability. Command model may later fork to
query model(s), and commands can also return simple data like sequence number of the produced events.

### Vertical & Horizontal Scalability

Expand Down
Loading