For tweets, it also allow multi media tweets:
All api endpoints should only be accessed by https.
All of the following endpoints need a user token to perform operations except for the registration and login
User Management
Tweets
User Table
User Relation table 1
User Relation table 2
Tweet Table
Tweet status table (Could be a non sql due to through put)
flowchart TD
B["User"];
C{"Load Balancer"};
D{"API Gateway"};
E["User managerment service"];
F["Tweet service"];
G["Discover service"];
I["CDN"]
H["Regulation Service"];
n1[("User Table")];
n2[("User Relation Table")];
n3[("Tweet Table")];
n4[("Tweet status Table")];
n5[("Blob")]
B --> C;
C --> D;
D --> E;
D --> F;
D --> G;
E --> n1
E --> n2
F --> n3
F --> n4
F --> n5
G --> n1
G --> n3
H --> n1
H --> n3
D --> I
I --> n5
sequenceDiagram
participant A as User
participant B as User Management Service
participant C as Tweet service
participant D as Database
participant E as Discover Service
participant F as Regulation Service
A->>+B: Register
B->>+D: create user
B->>-A: user created
A->>+B: Login
B->>D: Autheticate
B->>-A: User token
A->>+B: With user token, follow/unfollo users
A->>C: With user token, read/post/like/retweet tweets
A->>E: With user token, fetch news and popular tweets
E->>D: discover new content and users based on their interests
F->>D: Delete data based on regulation
All the services are independent and stateless so that they can be scale out easily.
User Management Service
Tweet Service
Discover Service
Regulation Service
Database