2024 · intermediate
Shared Nothing Architecture - How to Scale to Infinity
After I retired from IBM, I wrote an application to help my dance studio schedule competitions. Now in my third year of production, and with 94 events in 42 cities in 5 countries on 3 continents, it is time to share my secrets to scaling:
Start with a single user. Run as many services as necessary on a single VM. This is the opposite of the micro-services approach.
Next run multiple users in separate apps with separate databases on a single VM.
Then run multiple clones of this VM, adding logic to route requests to the correct machine.
For larger tasks, start up special purpose machines to handle requests when needed, and stopping them when the requests are done.
Set in place a system that produces continuous backups - this enables you to switch machines when there is a failure.
Ensure that you have a logging system and that the logging system itself is both monitored and has redundancy.
For those updates that require momentary down time, start something fast to show the user while they are waiting.
Build an administrative interface to provision new users.
The source to this application is on GitHub and you can run a demo online. The application is written in Ruby on Rails and is deployed to fly.io, but the ideas apply to other frameworks and hosting providers. Links to the demo, docs, and code can be found here.