DevScript Saga

Welcome to DevScript Saga!

A little Helping Hand for Devs


Scaling from Zero to Billions

Designing a system that supports millions of users is challenging. In this series of blogs, we build a system that supports a single user and gradually scale it up to serve millions of users.

Single Server Setup

To start with simple, let us say, web app, database, cache everything is running on one server. See below figure:

This image has an empty alt attribute; its file name is img_0134-1.jpg

Users access websites through domain names, such as devscriptsaga.com. A Domain Name Server (DNS ) returns the IP address (say 17.124.32.211) associated with the domain name. Once IP address is received, HTTP requests are sent directly to your web server. And the web server returns requested HTML page or JSON response.

With the growth of users, one server is not enough and we need multiple servers: one for web/mobile traffic and the other for database.

Separating web/mobile traffic (web tier) and database (data tier) servers allows them to be scaled independently.

This image has an empty alt attribute; its file name is img_0135-1.jpg

Which Database to Use?

1. Relational Databases represent and store data in tables and rows. We can perform join operations using SQL across different tables.

2. Whereas in non-relational databases may have key-value stores, graph stores, column stores, and document stores. Join operation is not supported on these databases.

Non-relational database might be the right choice if our data is unstructured (images, videos etc.), and our massive application requires super-low latency.

...Next : Vertical vs Horizontal scaling

Leave a comment