Design of Google Docs
We'll cover the following...
Design
We will design the system in two steps: first, selecting the components, and second, defining the workflow to meet the functional requirements.
Components
The design utilizes the following components:
API gateway: Intercepts and routes client requests. It handles authentication, rate limiting, and directs edit requests, comments, and notifications to the appropriate services. It can also serve cached responses directly.
Application servers: Execute business logic and compute-intensive tasks. This includes file format conversion (e.g., PDF to Word), import/export functionality, and attribute collection for the recommendation engine.
Data stores: We use specific storage solutions for different data types:
Relational database: Stores user information and document metadata to enforce privilege restrictions.
NoSQL: Stores user comments for fast retrieval.
Time series database: Records the edit history of documents.
Blob storage: Stores media files like images and videos.
Cache (Redis) and CDN: Redis stores user sessions, typeahead features, and hot documents. The CDN serves static assets and heavy objects to improve end user performance.