Patterns

One box

Run the code and the data on one machine. It is the cheapest way to launch and the right place to start.

Start with one machine that runs your code and holds your data.

Move up when#

  • The box's load bar sits near full for minutes at a time, and p99 climbs with it.

  • A slow query or a traffic burst slows every page, because code and data draw on the same CPU and memory.

  • You want to resize the app and the data separately.

The Design#

Drag to pan. Hold Ctrl or Cmd and scroll to zoom.

At 200 Users the Simulation solves this Design to Apdex 1.00, p99 266 ms, 0.0% errors and $0.05/s Burn.
WhereSettingValueWhy
App ServerLocal databaseOnThe app keeps its data on its own disk, so there is no second Node to run or pay for.
App ServerInstance sizemicroMicro is the starter box. It is enough for a few hundred Users.

Users reach one App Server. Its Local database setting keeps Postgres on the same machine, so there is no second Node, no Link to call over, and no second bill.

Why it works#

At a few hundred Users the work is small and so is the bill. A request reads from a disk it shares a machine with, and you have one thing to deploy, watch and restart. You also learn what your traffic looks like before you pay for structure you may not need.

What it costs#

One machine is one failure. When the host dies, the app and the data die together, and every request fails until you replace it. Code and data also fight over the same CPU, RAM and page cache, so the busier one starves the other, and you cannot grow either alone.

In Quorum#

The starting App Server runs Postgres on its own box until you link it to a Database. An Instance failure shows what the single box costs. The next rung is to split the server and the storage.