1、Why and how we re-architected SlackIan HoffmanGeocentric Model of the Solar SystemHeliocentric Model of the Solar SystemWhat does this tell us?Subpar architectures can work for a long time001But they will become increasingly complicated002A better architecture will simplify complex problems003You sh
2、ould question your model004Hi,ImIan HoffmanStaff Engineer,SlackPreviously ChairishSlacks V1 ArchitectureThe Workspace ModelSlack OverviewCommunication app for businessesFirst-party Desktop client(Electron)and iOS/Android appsBackend is a monolith written in Hack(sort of like PHP)We run MySQL sharded
3、 using VitessSlack Architecture V1 1 Customer=1 WorkspaceSlack Architecture V1 Workspaces contain users,channels,messages,apps,etcSlack Architecture V1 Each workspace is a closed systemSlack Architecture V1 Architectural ImplicationsData for a single workspace is on a single database shard001Server
4、routes queries from workspaces to shards002More customers?No problembuy more shards003Slack Architecture V1 Slack Architecture V1 Loading an app in the workspace modelWhat if the data for one customer cant fit on one shard?ProblemsSlack Architecture V1 What if customers want multiple workspaces?Prob
5、lemsSlack Architecture V1 Slacks Architecture V2Enterprise GridEnterprise customers can have many workspacesSlack Architecture V2*Within the enterpriseEnterprise users can belong to many workspaces*Slack Architecture V2*Within the enterpriseData(channels,apps)can be shared with multiple workspaces*S
6、lack Architecture V2*Within the enterpriseData(channels,apps)can be shared with multiple workspaces*Slack Architecture V2*Within the enterpriseArchitectural ImplicationsAn“org”serves as a parent for many workspaces001Data for the org is stored on a single database shardIncludes channels,apps,etc tha