Designing scalable Notification System

aditya goel
3 min readOct 23, 2023

Question → What kind of Notifications are we talking about here?

Question → When do we have to send the Notifications ?

Answer → When some 2 customers does the transaction with the help of Payment-Gateway, then the Payment-Gateway has to send the timely notifications to both of the involved parties (i.e. Payer and Payee both) as shown below :-

Question → Why SLA is very important in this kind of Notification-System ?

Answer → Given the money is involved, maintaining a strong SLA is critical.

Question → Design the Base Version of Notification-System ?

Question → What is the main issue in the above design of Notification-System ?

Answer → Because the transactions (i.e. Notifications) are persisted in realtime (i.e. in Synchronous mode) to the database , therefore the p99 latency is not so good.

Question → What are the main challenges in scaling of this design of Notification-System ?

Question → How do we re-architect the design of Notification-System, so that it can handle the load & scale easily ?

Answer → We shall have to take-up multiple measures in order to re-architect the Notification-System :-

With this, we created multiple queues, in order to handle the different types of Notifications depending upon their priority-order.

Another measure is to reduce the DB-Bottleneck, by making the writes asynchronous :-

The overall design now looks like this :-

Question → What are different types of Observability metrics that we should have in this kind of system ?

Thanks for reading through this. See you in some other blog. Thank You.

References :-

--

--

aditya goel

Software Engineer for Big Data distributed systems