0

I wish to know how Salesforce designs their Multi-Tenant database.

My questions are as follows:

  1. Is every tenants and users stored in a central master user database?

  2. Does every tenant have their own database or does a number of tenant (10K for example) shares one database and fetch their own section of data by OrgID?

3

You will find plenty of documents on this if you Google. A good one is The Force.com Multitenant Architecture whitepaper.

Answers:

  1. Salesforce operates multiple instances (pods) and many tenant's data is stored in each one.
  2. One database is shared by many tenants:

All Force.com data, metadata, and pivot table structures, including underlying database indexes, are physically partitioned by OrgID (by tenant) using native database partitioning mechanisms.

On the subject of user scaling, login is handled centrally and after login a user is forwarded to an instance with a specific OrgID. The username has to be globally unique, and each username is tied to an instance and OrgID. I don't know of any documentation on how that login server is made to scale, but it only needs to hold a small amount of information per user so scaling is presumably a manageable problem.

6
  • Thanks for your help! I have some doubts from the source. I understand that Salesforce instances will scale according to demands. But what about the database? Let say today Salesforce have 10million users in total, does all the 10million users be stored inside the same database? If not how does the system know which database to find the user record from just one login portal?
    – Norman
    Apr 28 '17 at 10:18
  • @Norman See addition to answer.
    – Keith C
    Apr 28 '17 at 10:27
  • Another good resource is the video recording from the "Future of Scale at Salesforce" session from Dreamforce '16. If I recall, it went pretty over my head, but had some nice details about the different technologies that Salesforce uses as the back-end to the service(s) they provide (spoiler: It's a lot of Apache Software Foundation stuff)
    – Derek F
    Apr 28 '17 at 13:24
  • @KeithC Thanks for the detailed explanation. May I confirm with you if my assumption is correct? Every account will be stored in a master user database and this database will store the user's db details (probably by region like US and Asia). Upon login the user will be redirected to the specific region and fetch data from their specific database. May I right to say this?
    – Norman
    May 2 '17 at 1:17
  • @Norman Yes. After login the session is redirected to an instance e.g. na27 or eu3 and that instance holds their data.
    – Keith C
    May 2 '17 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.