Case study: enlistment day

On enlistment morning thousands of students use the same system within minutes. This case study tests which part of the system runs out of capacity first.

At 8:00 on enlistment day you open the online enlistment system and look through the list of sections. You press Enlist on a section that has one open slot. The page waits, then tells you the slot is yours or the section is full.

Student's browserSends requests
Enlistment web serversWeb tier
Slot recordsPrimary database
Think first. A university can add web servers in minutes, yet enlistment can still be slow at 8:00 AM, so which part of the system is the limit?
Ask for a show of hands: who has seen the enlistment system slow down on enlistment morning? Listen for students who blame the web servers, and steer them toward slot reservation.

Enlistment morning has two kinds of work. Read the two cards.

Browsing the catalog

Reading class schedules and open slots. Everyone wants the same few pages.

mostly readscan be cached
Reserving a slot

Taking one of 40 slots in a popular section. The result must be correct.

a writeone at a time per slot
More detail

A cache is a fast store of recent answers, so the database is asked less often. Replicas are read-only copies of the database. Both can serve browsing, which is mostly reads. Slot reservations cannot be cached and cannot be spread across replicas, because two students must never get the same last slot.

The model assumes 15 requests per enlistment session, 3 of them reservations.

Compare the on-premise setup with the cloud setup. Switch on each change and watch which bar goes over its maximum.

Where the load goes
Peak arrival rate— rps
Web tier maximum — rps
Load reaching the primary database— ops/s
Primary database maximum400 ops/s
Changes
More detail

Change the size of the crowd. Rates are in requests per second (rps) for the web tier and database operations per second (ops/s) for the database. Without staggering, the start bursts at about 6 times the average rate, because everyone clicks at 8:00:00.

The shape is typical of student enlistment systems. Every number here is made up for teaching.

Autoscaling fixed the web tier. The database is still one primary, because every slot reservation must be exactly right. Two changes help without buying hardware. Staggering flattens the peak, and sending browsing to read-only copies leaves the primary with only reservations.

You can now say which tier fails first on a busy day and how to relieve it.

More detail

Such systems have often run on a handful of application servers with a single relational database behind them. Many have since moved to cloud hosting, where web tier capacity can be bought in minutes. Load balancers and scaling showed that once the web tier is fixed, the database is the next bottleneck.

On-premise means the servers are owned and run by the university. The hardware was fixed, so adding capacity meant buying and installing a machine. Autoscaling means the web tier grows automatically when the load rises.