How I would have designed the JKJAVMY AstraZeneca appointment database

Designing for traffic spikes is a challenge

A litany of failures

  • No visual feedback to the user when appointment slots fail to load — the user has no idea what to do next.
  • Loading appointment slots and submitting the form caused several errors, all with no visual feedback and no indicator on what to do next. Some of the errors returned were “500 Service Unavailable/Timeout” (seen above). Other times, the error was “429 Too Many Requests”, which means that the user should NOT retry what they are doing, or risk being blocked for a longer time — this ommission is especially fatal because of the lack of visual feedback.

It’s all about the database

  • Most monolithic databases cannot scale automatically — my intuition is this is why the system needed to be down at 10am-12noon.
  • Once you have allocated the largest database size available (about 100 CPU units on Amazon Web Services), you are out of options. You can only watch helplessly as all your tables and connections lock, and your users undergo a roulette of whether both their request to get the appointment slots AND submitting their form both go through.

Partitioning is the answer

A monolithic start
The visual design gives us a hint of how to prepare the data for high traffic.
A data model representing partitioning by PPV
A highly scalable example where data is partitioned by PPV and day.

Please do better

--

--

--

Full-stack software architect and technology leader from Kuala Lumpur, Malaysia

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

From Doctorate to Dojo: Redefining Healthcare Through Code

Meet the people fixing interop in healthcare at Lifen

DP is easy — Part-7

Best practices for cache control settings for your website

Camera Plugin for Unity

Multitenant Azure App Services Security

Software Analysis (Basic Introduction)

Creating a Wave System for our Enemies

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Timothy Teoh

Timothy Teoh

Full-stack software architect and technology leader from Kuala Lumpur, Malaysia

More from Medium

Make database isolation levels understandable

[TIL-6] Why pagination is slow?

Lessons learned from Downsizing Mongo 3.6 by removing Shards

Robinhood Backend System Design — How to Receive Realtime Stock Updates