0

There are millions of website around, but how the big website's background storage works? Like Slack? Anyone can create an unique workspace in Slack, and it will provide you a fresh installation/environment to user. But question is how it stores data into backend?

  • Does it create a separate database for each workspace?

  • if yes, say there are 500 millions workspace users are there, so there are 500 millions database there? Does hosting company allows that? What is the limit?

  • if no, how it separate the data? Say there is a "users" or "orders" table, which generate user id or order id. How different workspace users get same user id or order id? If all workspace data stores into same database, how we can get specific workspace data or connect to it?

-Is there any feature in Database for this type of data segmentations?

Please help.

My current thought is that, we need to create multiple database for each workspace. But I am not sure if this a feasible solution. I am seeking if there is any feature in Database which allows me to segment the workspace data to save and retrieve.

  • Think about database. What type of database? I think it's a NoSQL database and each workspace is a single collection. In addition, you should shard the dispatch of your workspace across different cluster to dispatch uniformly the traffic. Finally, you can have low SLA for free user and migrate data to high SLA database for paid users. – guillaume blaquiere Apr 27 '23 at 12:12
  • Primarily I am think about MySQL (or any other database which can handle huge storage). I am not sure how this architecture works. We are creating a website for some service, so every new client will get a new instance / workspace for it, just like a new website. How we should save the data for different client? – Md. Shafiq Hossain Apr 27 '23 at 12:19
  • Indeed, legacy relation database shouldn't support that use case. Document database allow a better scalability, but it's no the same feature and use case as a relational database – guillaume blaquiere Apr 27 '23 at 15:15
  • @guillaumeblaquiere relational databases can handle such business cases through storing users in one table and associating any other details with the user records through foreign keys in other tables. – Shadow Apr 27 '23 at 20:07
  • NoSQL database also! With embedded document for instance. It really depends on the dependency hierarchy and your preferred strategy – guillaume blaquiere Apr 27 '23 at 21:26
  • How to do it with huge scale: [Platform Multitenant Architecture | Salesforce Architects](https://architect.salesforce.com/fundamentals/platform-multitenant-architecture) Put simply, you can't create a separate _anything_ per user/company. It has to be shared architecture with a customer identifier that stops you seeing other people's data. – John Rotenstein Apr 27 '23 at 22:36
  • Usually they do not create a new database for each workspace. You could start by just having a workspaceID in your database. – user253751 Apr 27 '23 at 23:20
  • But thing is that, if we store all workspace data into single table, what will happen backup and re-store the data? and If I like to give user id=1 for all workspace, how to achieve that? – Md. Shafiq Hossain Apr 28 '23 at 18:25

0 Answers0