Member-only story
How to Design a Scalable Chat Application Schema in MySQL and NoSQL
3 min readJun 21, 2025
User schema
Table: users
Description: To store user details.
### 📄 User Table Schema
| **Column Name** | **Data Type** | **Description** |
|-----------------|------------------|-------------------------------------------|
| `id` | `UUID` | Primary key. |
| `name` | `VARCHAR(255)` | User's display name. |
| `email` | `VARCHAR(255)` | Unique email address. |
| `password` | `VARCHAR(255)` | Hashed user password. |
| `image` | `VARCHAR(255)` | Path to the user's profile image. |
| `created_at` | `TIMESTAMP` | Timestamp when the user was created. |
| `updated_at` | `TIMESTAMP` | Timestamp of the last update. |
Additional information
image: Nullable. Path to the user’s profile image. If null, a default image is shown.
Chat Group schema
Table: chat_groups
Description: To manage chat group.
### 📄 Chat Group Table Schema
| **Column Name** | **Data Type** | **Description**…