System Design Notification Service
High Level Architecture:
● LoadBalancer: equal distribution of requests among request processing servers
● Metadata Database: Store information about topics and subscriptions
● Metadata Service: Separation of concern service, acts as a cache between database
and other components (Distributed Cache)
● Temporary Storage: Connects with f rontend service to store published messages
temporarily as subscribers may not be available simultaneously
● Subscriber Service: Service retrieves messages from Temporary Storage and sends
them to subscribers. This message also interacts with Metadata Service to get
information of Subscribers
● Frontend Service: lightweight microservice deployed across several data centers,
performs actions like request validation, authentication, authorization
○ Consist of reverse proxy
Technology Stack
● FrontEnd Service => Microservice using Spring boot
● Metadata Service => Apache Kafka zookeeper
● Temporary Storage => Messaging queue
● Message Retriever => using semaphore
Database Design
● User => id (int)
○ Type (String) [Sender, Receiver]
○ Message [N:N]
○ timestamp
● Message => id(int)
○ Description (String)
○ Timestamp
● Metadata_Service => id(int)
○ Message_id (int)
○ Sender_id(int)
○ Subscriber_Service_id(int)
● Subscriber_Service => id(int)
○ Metadata_Service_id (int)
○ Receiver_id (int)
Non-functional Requirements:
● Scalability: System should support large number of topics, producers and consumers
● Availability: should be available, and overcome hardware and software failures
● Performance:latency should be as low as possible
● Durability:each subscriber must receive every message at least once