Starting from Scratch: System Design Lesson 1

Priya Srivastava
2 min read4 days ago

The first and foremost thing to keep in mind is you have to make a generic structure in your mind for all system design questions and then improvise and enhance yourself over that basic structure

You have to understand the basic pattern :

Lets see the below design and lets try to use this as our base for further lessons .

I know it is looking so much overwhelmed to you …

But take a deep breath , will do it step by step and with baby steps :

BABY STEPS :)

We will go in-depth in each of us in our next lessons , we want to grasp basic structure first :

  1. Our request will go to API-Gateway which act as entry point to our system
  2. Then our request will go to Load balancer , which is responsible for manage that not only one server will get too many requests, request get distributed on other instances too , to ensure proper working of system
  3. Then distributed cache is used so that we can reduce latency , not everytime we need to make a call to backend
  4. Then comes our structure where we use kubernetes , docker and multiple instances of backend services , in short backend services will serve your business requirement , kubernetes will manage the autoscaling in case of less request coming we dont want all the instances to be up .
  5. Then Cache can be used (here keep in mind : Cache invalidation,cache eviction policies)
  6. The structrured data will go to rdbms

6'1 . Here the leader follower architecture is followed (Replication strategy is used to serve the high reads kind of requirement and also to reduce the data loss if leader goes down)

7 . Data which is being required is send back to the services , once business logic serves the requirement and process is success .

7'a. Data is also send to ELK , Kibana , Grafana for observability metrics and logs tracking

8.9.10

User needs to be notify their request is completed , for that notification message is sent to notification queue , so that message persist there even if the user is offline .

Exception :

8'a-8'b

In case request is not processed succesfully due to some connection issue or techincal failure , the request(or message) will be send back again to the services for reprocessing

5'a-5'b

The usecase where we need to store unstructured data we save the data in no-sql database and also send the data to Kibana/Grafana/ELK for analystical purposes or log tracing.

Thank you keep growing my people ….

--

--

Priya Srivastava

Focussing on the improvising the knowledge and sharing the journey of starting from scratch and then become the master of all.