What Is a System?

Concept. A system is components chosen to work with each other. Its speed is set by its weakest part and its cost by all of them. Systems design is picking the right trade-off for every subcomponent: fast enough for the job, and no faster, because anything past the weakest part is money you cannot use.

Intuition. Say you want a car that will do 150 mph on a road. A jet engine is plenty, but bolt it to a chassis made of Lego and the chassis fails at walking pace. The Lego is the bottleneck, and you paid for the jet anyway.

The goal is a car that will do 150 mph on a public road. Three bins of parts with labelled options, then three cars built from them. Engines E1 motorbike 130 mph $5k, E2 turbo four 150 mph $12k, E3 jet 400 mph $2M. Chassis C1 Lego 2 mph $50, C2 steel 150 mph $10k, C3 carbon 250 mph $5M. Wheels W1 road 150 mph $600, W2 sport 200 mph $2k, W3 slick 250 mph $50k. Builds: E3 plus C1 plus W3 does 2 mph for $2.05M because C1 is the bottleneck, E3 plus C3 plus W3 does 250 mph for $7.05M which is 100 past the goal, E2 plus C2 plus W1 hits the goal exactly for $22,600.

Figure 1. The goal is a car that will do 150 mph on a road. Pick one row from each bin; the car then runs at its slowest part and costs every part in it. E3+C1+W3 spends $2.05M and travels at walking pace: C1 is the bottleneck, and no engine above it matters. E3+C3+W3 has no bottleneck at all and is still wrong, because 100 mph of it is past anything the goal asked for, at $7.05M. E2+C2+W1 hits 150 on all three parts at once for $22,600.

Systems design is picking the trade-offs

Fast parts cost more than slow parts. Spend everywhere and you overpay for capability the weakest part will never let you use. Spend nowhere and the job does not get done.

So the work is one decision per subcomponent, made against the job and against the other parts: how fast does this one have to be? Get every call right and the parts run out together. Get one wrong and it either caps the system or wastes what you spent on it.

The same problem, for data

The parts that hold your data are memory, SSDs, disks, databases, and more machines. The same trade-off runs through all of them, and the spread is far wider than anything on a car: the fast end costs orders of magnitude more per byte than the slow end, and the next page measures the gap exactly.

The goal is to serve 10,000 requests a second. Storage S1 disk 1,000 r/s $200, S2 SSD 10,000 r/s $600, S3 memory 100,000 r/s $4,000. Database D1 local 1,000 r/s $200, D2 cloud 10,000 r/s $2,000, D3 NoSQL 100,000 r/s $15,000. Servers P1 two nodes 1,000 r/s $400, P2 twenty nodes 10,000 r/s $3,000, P3 two hundred nodes 100,000 r/s $30,000. Builds: S3 plus D1 plus P3 serves 1,000 r/s for $34,200 because the local database is the bottleneck, S3 plus D3 plus P3 serves 100,000 for $49,000, S2 plus D2 plus P2 hits the goal exactly for $5,600.

Figure 2. Same bins, same arithmetic, and a goal of ten thousand requests a second. S3+D1+P3 puts everything in memory and rents two hundred nodes, then serves it all through one local database: D1 is the bottleneck, so the system does a thousand a second and pays $34,200 a month to miss the goal. S3+D3+P3 has no bottleneck and is still wrong, at ten times the goal for $49,000. S2+D2+P2 hits it exactly for $5,600. Storage, database and servers do the job the engine, chassis and wheels did.

Every system in this course, from a laptop running Pandas to the one serving eight hundred million people, makes this same choice at a different scale.

Takeaway

A system is not its best part. It is how the parts fit each other and the job. For the rest of this course those parts hold data, and the question never changes: how fast, and at what cost.