How it works · 41 of 49 Advanced
What is space-based architecture?
Taking the database out of the rush (ticket sales, trading)
Space-based: Space-based architecture keeps the live data in memory, split and copied across many identical processing units, so a sale never waits on the database during the rush; the units write their changes to the database later, in batches (write-behind).
Loading the animation…
Say it like this Space-based architecture keeps the live data in memory, split and copied across many identical units, so no request waits on the database during the rush; the units write to the database later, in batches.
Under the hood — for builders
- Worked example: the card's stadium
- One window writes every sale to the database before the next fan is served, so the database's write rate sets the queue. Space-based gives each gate (processing unit) its own seats in memory; a sale is a change in that memory, copied to a neighbour, and written to the database later with all the others. The stadium is our example, not a source's.
- The sources, in their words
- Wikipedia: "a distributed-computing architecture for achieving linear scalability of stateful, high-performance applications"; a processing unit is "The unit of scalability and fail-over"; the data grid "Manages the data in distributed memory with options for synchronizing that data with an underlying database". Apache Ignite: write-behind will "accumulate updates and asynchronously flush them to the underlying database as a bulk operation".
- Terms
- Processing unit: one copy of the app plus its share of the live data, in memory. Data grid: the memory of all units acting as one store, split and copied. Write-through: the database is written in the same step as memory (Hazelcast: "synchronously"). Write-behind: written later, in batches (Hazelcast: "asynchronously, after a configured delay").
- Run here: how long the last fan waits
- Python 3.13 and SQLite on this machine: one committed transaction per sale managed 9,190 sales a second; one in-memory unit on one core handled 3,675,202 requests a second, 400× faster (350–400× over three seeds). Log scale: each grid line is ten times the last.
- Run here: the night van
- Writing all 50,000 sold seats to the same database in one batch transaction took 0.048–0.054 s over three seeds, against 9,190 a second when each sale was its own transaction. That is why write-behind batches.
- Measure it
- Peak requests a second vs the database's write rate · write-behind delay (seconds of sales held only in memory) · copies per unit · time to rebuild a lost unit from its copy.
- Watch out
- Apache Ignite: write-behind "can lead to a potential drop in consistency as some updates could be lost due to node failures or crashes." Keep a copy of each unit's data on another machine, keep the delay short, and remember that reports read from the database lag the rush. Worth it only when load spikes past what one database can write.
- Sources
- Wikipedia, "Space-based architecture", last edited 25 Sep 2026 · Apache Ignite docs, "External Storage" · Hazelcast 5.5 docs, "Building a Cache with MapStore" · all read in session · window and batch runs, Python, 21 Nov 2026.
What happens in the space-based animation, step by step?
- Sale day. One ticket window at the main gate rings the vault, the database, for every seat it sells. With a thousand fans, the last one waits a tenth of a second.
- Your turn: slide the crowd from a thousand fans to a million. The window can sell only as fast as the vault answers, one write at a time.
- Now open a cash box at every gate, each holding its own block of seats in memory. Slide again: no sale waits on the vault. A cache wouldn't do this; a cache speeds up reads, and every sale is a write.
- After the rush, a night van carries every box's takings to the vault in one trip. The database is still the record; it is written later, in batches. That is write-behind.
- The risk: a box can fall over before the van comes. Each box keeps a copy of its tally in the next gate's box, so its sales survive. Lose both, and those sales are gone.
- Live data in memory across many units, copied, written to the database later. Next: one web page built by five teams at once, micro-frontends.
What everyday example explains space-based?
A cash box at every stadium gate, carried to the vault after the match. Each gate sells its own block of seats from its box; a neighbour's box keeps a copy of the tally; the night van takes the takings to the vault in one trip. One window that phones the vault for every ticket is the design it replaces.
Why should a team care about space-based?
When load comes in spikes you cannot predict (a ticket drop, an auction close, a market open), you choose between a database that must survive the peak and live data held in memory that you must protect from loss; space-based picks the second, and buys copies and a write-behind delay to do it.