Tables for Slack Clone
Let's get started by looking at the data model.
Users
The primary functionality of the app revolves around users and their messages.
So we have the following tables.
users
anduser_message
Workspace
Slack app has workspaces where users can join. It is managed by the owner and the admins of the workspace. The following tables takes care of this requirement.
workspace
,workspace_member
andworkspace_user_type
Channel
Each workspace can have channels scoped to a specific topic of discussion having subset of members from the workspace. Members of the channel can post messages to the channel that everyone can see.
channel
,channel_member
,channel_thread
andchannel_thread_message
The final model roughly looks like the following with basic relational columns:
Note that it doesn't have the detailed column list, but it should give an idea of the relationships between different entities.
- Build apps and APIs 10x faster
- Built-in authorization and caching
- 8x more performant than hand-rolled APIs