There would be 200M new meeting a day.
Each meeting needs data such as name, description, list of invitees, status. I would estimate it to take 2KB / meeting.
That's 400GB of data every day.
In 2 years, it would require 400 * 365 * 2 / 1000 = 292 TB of data.
I think a relational DB is a good choice for storing meeting data because:
See the diagram.
Client send all the requests to API Gateway.
I am introducing only one service, Meeting Service, because all the queries are related to the core functionality: CRUD for meeting. Therefore, all requests are handled by Meeting Service.
Meeting Service executes the CRUD operations (querying schedules, creating meeting, updating meeting ...) primarily using Database.
When Meeting Service has to send emails (e.g. to notify invitees), it would create a message in Message Queue (e.g. Kafka).
Notification Service pulls messages from the queue, and sends email notifications to the invitees.
Meeting Service uses cache (e.g. Redis) to store frequently accessed information, such as user metadata or meeting details.
schedule_meeting() would create an entry in RDB:
Meeting:
Meeting_Invitee:
Meeting_Invitee table joins Meeting table and Employee table.
This data model helps following steps, such as view_schedules() call.
To query schedules of employees, Meeting Service looks up employees in Meeting_Invitee table. Based on that, look up Meeting table, filtered by time.
An optimization may be necessary to improve this look up performance. In this data model, the service would have to look up all the meetings for a particular employee. This would be too much. We can add additional information, such as date (or week or month), in the Meeting_Invitee table. The service can use this information to filter meetings.
Sharding would be important as the use case scales.
org_id (Organization ID) would be a good choice as a sharding key. Most meetings are scheduled within one organization, including mostly employees of the organization. By sharding the data with org_id, accesses would be heavily localized, making caching effective.
Some organizations would be bigger, or more active, than others. As such, we need to carefully plan which organizations are supported by which DB nodes. An idea of consistent hashing - dynamically adjusting the responsibility of each node - can be applied to RDBs, but are harder to implement than some NoSQL DBs. As such, we should carefully project the workload of each organization and assign it to an appropriate DB node.
Most major components, e.g., Meeting Service, Notification Service, Cache, Message Queue, are either stateless or support horizontal scaling. We should take advantage of such feature for fault tolerance (e.g. when one node goes down, another can take over) and scalability. We should monitor these nodes for service latency and resources. Auto-scaling can be applied to some components, e.g., Meeting Service.
Database is a little more tricky as RDB is not horizontally scalable.
Primary-Secondary configuration (with read only replicas) can be used to provide fault tolerance and scalability. As discussed earlier, sharding also provides scalability.
Meetings have this important property: once it is finished, the data will be less important. Things like descriptions, names, or invitees, wouldn't change.
This presents an opportunity for optimization in the Database. We can have a service that periodically checks finished meetings, and move that data out of the main DB to a secondary storage. The history of past meetings could be important, so we would store it in a less expensive, less performant storage.
This would allow us to keep the main DB smaller, improving scalability and fault tolerance.