Back to Home | Cirra | Published on October 8, 2025 | 82 min read
Download PDF
Salesforce Database Architecture: A Multi-Tenant Deep Dive

Salesforce Database Architecture: A Multi-Tenant Deep Dive

Executive Summary

Salesforce’s internal database architecture is a hallmark of cloud multi-tenancy, enabling thousands of organizations to share the same infrastructure while keeping their data isolated and secure. This report provides a deep dive into how Salesforce’s database works, the architectural decisions behind it, and the technologies that power its scale. Salesforce’s core platform relies on a single, shared relational database (primarily Oracle) that stores the data for over 8,000+ customer organizations per instance (Source: www.slideshare.net). To achieve this, Salesforce adopted a metadata-driven, multi-tenant design: instead of provisioning separate databases or schemas for each customer, all customers’ data resides in common tables distinguished by tenant identifiers. This approach yields tremendous economies of scale – with automatic updates, unified optimizations, and high performance at enterprise scale – but required innovative engineering solutions in data modeling, partitioning, and query optimization.

At the heart of Salesforce’s design is a universal data dictionary and pivot-table model that virtualizes each customer’s schema. When a Salesforce user creates a custom “object” (analogous to a table) or adds a custom field, no new physical table or column is added at runtime. Instead, Salesforce records the definition as metadata in special system tables, and maps all tenant data into a set of big shared tables (Source: www.slideshare.net) (Source: itsmedinesh31.wordpress.com). Every record is tagged with a tenant (OrgID), and every query implicitly filters by OrgID so that each customer sees only their own “virtual” database within the shared store (Source: www.forcetalks.com). Salesforce’s engineers leveraged the full power of the underlying Oracle database – from sophisticated indexing and partitioning to ACID transactions – to ensure security, isolation, and performance. The data is horizontally partitioned by organization using hash-partitioning and clustering so that queries naturally prune to each tenant’s subset (Source: architect.salesforce.com). The application servers are stateless, pushing all state to the database, which serves as the system-of-record and maintains consistency across the multi-tenant environment (Source: www.slideshare.net). Additionally, Salesforce employs external caching and search technologies (like memcached and Solr) to offload work, and uses governor limits and resource isolation techniques to prevent any one tenant from monopolizing shared resources (Source: architect.salesforce.com) (Source: architect.salesforce.com). These architecture choices – combining a shared everything model with robust safeguards – allowed Salesforce to scale to billions of transactions per day while serving 150,000+ businesses globally (Source: backlinko.com).

This report elaborates on each aspect of Salesforce’s database internals: the metadata-driven schema, the “no DDL at runtime” principle, the structure of core system tables, the use of smart indexes and pivot tables to simulate traditional DB indexes and relationships, and the partitioning and replication strategies that underpin its reliability. We also examine case studies such as how Salesforce addresses extremely large data volumes (through features like Big Objects and Skinny Tables) and how the architecture has evolved (e.g. the recent Hyperforce initiative to run Salesforce on public cloud infrastructure). Insights from industry experts and Salesforce’s own engineering leaders are included to provide multiple perspectives – from the rationale behind relying on Oracle as the engine, to predictions about Salesforce’s possible database future. In conclusion, Salesforce’s database architecture showcases a blend of classic relational database strengths and cloud-era innovations, offering valuable lessons for software engineers on designing scalable, multi-tenant data systems.

Introduction and Background

Salesforce, founded in 1999, pioneered delivering enterprise software (CRM) via the web, which required an architecture starkly different from traditional on-premise systems. Instead of giving each customer their own software instance and database, Salesforce opted for a single, shared application instance for all customers (Source: www.slideshare.net). This multi-tenant model meant huge cost savings and agility – Salesforce could maintain one codebase and deploy updates to all users at once – but it posed a significant technical challenge: how to design a database that securely and efficiently serves many customers on the same set of tables and hardware. In the late 1990s and early 2000s, this was a radical approach. Traditional enterprise apps often used a separate database per client or per deployment, but Salesforce needed to serve thousands of companies on a unified backend. The architects chose to build on a proven relational database system (Oracle) and layered a custom multi-tenant storage architecture on top of it (Source: www.techtarget.com) (Source: www.techtarget.com).

Several key background factors influenced Salesforce’s database design:

  • Enterprise Data Requirements: Salesforce’s customers demanded the reliability and consistency of an RDBMS. Enterprise CRM data (accounts, contacts, transactions, etc.) require strict ACID compliance – no lost or corrupted transactions – and strong integrity (e.g. foreign key relationships, unique constraints) (Source: www.packtpub.com) (Source: www.packtpub.com). In 1999, relational databases like Oracle were the trusted choice for these guarantees. Salesforce’s decision to use Oracle’s RDBMS provided immediate access to those benefits: robust transaction handling, SQL querying, backup/recovery tools, etc. Marc Benioff (Salesforce’s CEO) struck a licensing deal with Oracle early on, ensuring Salesforce could scale on Oracle’s technology (Source: www.techtarget.com). This choice gave Salesforce a solid foundation, albeit one that also meant outsourcing a core part of their stack to a competitor (Oracle’s Larry Ellison loves to point out, “Salesforce runs entirely on Oracle” (Source: www.techtarget.com).

  • Customization and Metadata: A hallmark of Salesforce’s offering is that each customer (“org”) can heavily customize data schemas (add objects/fields) and business logic, without Salesforce engineers manually altering database schemas for each. </current_article_content>This necessitated a “metadata-driven architecture” where all customizations are stored as data, not as actual schema changes (Source: architect.salesforce.com) (Source: architect.salesforce.com). Salesforce’s platform had to be extremely flexible: one customer might add 20 custom fields to the “Account” entity, another might add 200. Supporting this via traditional means (like altering SQL tables for each org) would have been untenable at Salesforce’s multi-tenant scale. Instead, Salesforce invented a way to represent custom objects and fields in metadata tables and map them onto generic physical columns. This innovative metadata approach is a core aspect of Salesforce’s internal database and is discussed in detail in later sections.

  • Multi-Tenancy vs. Isolation: The architecture had to ensure data isolation – no customer should ever access another’s data – while still co-hosting data for scalability. Salesforce chose a “shared database, shared schema” approach, as opposed to spinning up separate databases or virtual machines per tenant. A shared approach greatly simplifies operations (one big system to manage rather than thousands of small ones) and means every customer is always on the same software version. Salesforce could push updates and bug fixes to all orgs simultaneously, a major competitive advantage over on-prem systems that needed individual upgrades (Source: www.slideshare.net). However, sharing infrastructure raised concerns of the “noisy neighbor” problem (one tenant consuming disproportionate resources). Salesforce addressed this via both software and organizational strategies: governor limits to cap resource usage per tenant, and careful capacity planning to distribute tenants such that load is balanced (Source: architect.salesforce.com) (Source: architect.salesforce.com). As context, by 2016 Salesforce was supporting 100,000+ organizations on a single platform (Source: developer.salesforce.com), with each Salesforce “instance” handling about 8,000 or more customers on a shared database (Source: www.slideshare.net). Clearly, without strong isolation mechanisms, this could have been chaotic.

  • Historical Evolution: In early years, Salesforce’s multi-tenant database design remained relatively consistent in concept, but it evolved and optimized as scale grew. Salesforce moved from a handful of instances in a single data center to dozens of instances (pods) across global data centers for geographical and load distribution (Source: highscalability.com). In 2013, for example, Salesforce reported 17 production instances in North America, 4 in EMEA, 2 in APAC, plus many sandbox (test) instances (Source: highscalability.com). Each instance had a cluster of application servers and a primary database system. Over time, Salesforce invested in more powerful hardware and (likely) Oracle features like Real Application Clusters (RAC) to scale vertically, and it refined its partitioning and indexing schemes to keep performance high as data volumes exploded. By 2018, speculation grew that Salesforce might re-architect away from Oracle to reduce dependency and cost, possibly by using open-source databases like PostgreSQL or new in-house systems (Source: www.zdnet.com) (Source: www.zdnet.com). Salesforce did hire PostgreSQL experts and toyed with the idea of “Sayonara” (a code-name rumored for an internal DB project) (Source: www.techtarget.com) (Source: www.techtarget.com). However, as of today Salesforce’s core CRM data storage still relies on Oracle’s technology for its proven reliability. The company has simultaneously been extending its data architecture (e.g. introducing Big Objects for big data workloads and launching Hyperforce to deploy on public cloud) – these are discussed in the Future Directions section.

In summary, Salesforce’s internal database represents the confluence of academic database principles and real-world cloud pragmatism. It’s grounded in the solidity of a single relational database of record, yet it achieves flexibility through an abstraction layer that makes this single database behave like thousands of individual databases (one per customer). The next sections delve into how exactly this works under the hood, including concrete details of the schema design, query processing, and the numerous auxiliary systems that support Salesforce’s massive-scale multi-tenant operation.

Architecture Overview: Multi-Tenancy and Virtualized Schema

Salesforce’s architecture is often described as multi-tenant and metadata-driven. These two concepts are intimately linked in how the database is structured. At a high level, Salesforce uses one logical database schema for all tenants, and within that schema, it maintains tables that hold every tenant’s data together. The trick is that each row is tagged by an OrgID (organization ID), and queries are always aware of the current OrgID context (Source: architect.salesforce.com) (Source: architect.salesforce.com). The platform’s runtime ensures that “all operations include Org ID” as a filter (Source: www.slideshare.net), effectively creating virtual per-tenant databases on top of the shared physical database.

Crucially, Salesforce does not create new database tables every time a customer creates a new object (like a custom CRM entity) or adds a field. Instead, it leverages a set of system tables (the “Universal Data Dictionary” and related tables) to store the metadata about customers’ schemas (Source: architect.salesforce.com) (Source: architect.salesforce.com). The actual data for all custom objects goes into a giant shared data table with generic columns, often referred to as a “heap” or MT_Data table in Salesforce literature (Source: www.slideshare.net) (Source: itsmedinesh31.wordpress.com). This design allows Salesforce to serve many tenants from one unified physical schema, and it avoids the need for runtime Data Definition Language (DDL) operations that could impede performance or require downtime (Source: www.slideshare.net). Below, we break down the main components of this architecture:

Metadata and the Universal Data Dictionary (UDD)

Salesforce’s Universal Data Dictionary is a collection of internal tables that describe the structure of each tenant’s “virtual” database. The primary tables here are typically known (in Salesforce’s technical papers) as MT_Objects and MT_Fields (Source: itsmedinesh31.wordpress.com) (Source: itsmedinesh31.wordpress.com):

  • MT_Objects – This table stores a record for each custom object (analogous to a table) that any tenant defines. Each row in MT_Objects includes an ObjID (object identifier), the OrgID of the tenant that owns that object, and the object’s name (plus other attributes) (Source: itsmedinesh31.wordpress.com). For example, if two different customers each create a custom object called “Project__c”, they would each get a distinct row in MT_Objects with different OrgIDs but perhaps the same ObjName “Project__c”. The ObjID is Salesforce’s internal reference to that virtual table.

  • MT_Fields – This table stores a record for each field (analogous to a column) defined on any object by any tenant. Each row contains a FieldID (field identifier), the OrgID, the parent ObjID (linking to which object the field belongs to), the field’s name, data type, an “indexed?” flag, and a field order (FieldNum) which represents the position of this field among the object’s fields (Source: itsmedinesh31.wordpress.com) (Source: architect.salesforce.com). Because every tenant’s fields across all objects are in this one table, the combination of OrgID+ObjID helps scope fields to the right virtual object.

Storing all orgs’ schemas in these tables makes Salesforce metadata-driven: the platform can interpret these tables to know, for example, that Org “ABC” has an object “Project__c” (ObjID 501), which has a field “Deadline__c” (FieldID 876, data type date, etc.). This approach provides extraordinary flexibility. As Salesforce’s documentation notes, by managing object and field definitions as metadata rather than real tables, the system can handle schema changes (adds, mods, deletes of fields) without requiring expensive table alterations or downtime (Source: itsmedinesh31.wordpress.com) (Source: itsmedinesh31.wordpress.com). In a traditional RDBMS environment, adding a column or altering a column’s type might lock the table or incur a long rebuild, but Salesforce avoids that by simply inserting or updating rows in MT_Fields and related metadata, while the underlying physical table remains unchanged. The runtime engine dynamically materializes the new schema at query time by interpreting this metadata (Source: architect.salesforce.com) (Source: architect.salesforce.com).

Of course, frequent access to metadata could become a bottleneck if not handled carefully – every user query needs to be parsed against their org’s custom schema, which means looking up definitions in MT_Objects/MT_Fields. Salesforce anticipated this and invested in massive metadata caching. It maintains distributed caches of recently used metadata in memory across the application tier, with transactional invalidation when metadata is changed (Source: architect.salesforce.com) (Source: architect.salesforce.com). This ensures that even though the metadata is stored in the DB, reads are typically served from cache, keeping schema access fast and scalable.

The Shared Data Store (MT_Data) and “Flex” Columns

The real magic of Salesforce’s design lies in how actual business data (the records of each object) are stored. All the customer data – across all orgs and all objects – is stored in a table commonly referred to as MT_Data (Multi-Tenant Data) (Source: itsmedinesh31.wordpress.com) (Source: architect.salesforce.com). MT_Data is essentially one gigantic heap table of rows, where each row can belong to any tenant’s any object. Key fields in MT_Data include:

  • A global record ID (GUID) – a unique identifier for each record in the entire system (Source: itsmedinesh31.wordpress.com). This GUID often encodes the Org and object in it (Salesforce IDs famously have a prefix that indicates object type, etc.).

  • OrgID – the tenant that owns this record (Source: itsmedinesh31.wordpress.com).

  • ObjID – which object (from MT_Objects) this record belongs to (Source: itsmedinesh31.wordpress.com).

  • A Name field – a generic field to store a human-readable name or identifier for the record (Source: itsmedinesh31.wordpress.com) (Source: itsmedinesh31.wordpress.com) (e.g., Account Name, Case Number, etc. depending on object type). This is used for display and for fallback search purposes.

  • Then a series of Value0, Value1, …, ValueN columns – these are the so-called “flex columns” or slots in which the actual field data is stored (Source: itsmedinesh31.wordpress.com) (Source: architect.salesforce.com). Every record has the same set of these generic value columns available, but each object (via metadata) maps its fields into specific ones of these Value columns. For example, Object “Account” might map its “Name” field to Value0, “Industry” to Value1, “CreatedDate” to Value2, etc., whereas Object “Contact” (in the same or another org) might also use Value0 for its “Name” and Value1 for “Email”, etc. No two fields of the same object use the same Value slot, but different objects can reuse the same slot number without conflict (Source: itsmedinesh31.wordpress.com) (Source: architect.salesforce.com). In practice, Salesforce has a fixed number of these flex columns – sources indicate on the order of 500 flex columns (Value0 through Value500) exist (Source: itsmedinesh31.wordpress.com). That effectively sets an upper bound on the number of fields an object can have that store data in this main table (standard + custom fields mapped to flex slots). Not coincidentally, Salesforce imposes limits on custom fields per object (often in the hundreds) to stay within this physical limit, and if an object approaches the limit, alternative strategies (like splitting into two objects or using Big Objects, as discussed later) must be considered (Source: www.packtpub.com) (Source: www.packtpub.com).

  • Other system fields – MT_Data also includes housekeeping fields like CreatedBy, CreatedDate, ModifiedBy, ModifiedDate (for audit trail) and an IsDeleted flag to mark soft-deleted records (Source: itsmedinesh31.wordpress.com). Large text fields (rich text or long text area) are not stored in the flex columns directly; instead if a field is a CLOB type, the actual content is stored in a separate table MT_Clobs which links back to the main record (Source: itsmedinesh31.wordpress.com). This keeps the main table’s rows relatively lean (since CLOBs can be very large, they’re offloaded).

How do flex columns work? Essentially, each field in MT_Fields has a metadata entry mapping it to one of the ValueN columns. For instance, suppose OrgID=001 has an object “Invoice” (ObjID=5001). That object has a field “Amount__c” of type Number. In MT_Fields, that field might be assigned FieldNum=7. That means that for any Invoice records, the “Amount__c” will be stored in the column Value7 of the MT_Data table. Another field “DueDate__c” (type Date) might be FieldNum=8 -> stored in Value8. The platform ensures, via the metadata, that within object 5001, each FieldNum is unique (no collision) (Source: architect.salesforce.com). But object 5002 (say OrgID=002’s Invoice object) might coincidentally also use FieldNum=7 for its Amount field – and that’s okay, because those records will have different ObjID and OrgID, so there’s no interference. In effect, Value7 in MT_Data may hold “Invoice Amount” for some records, “Case Subject” for others, etc., depending on the object context of each row (Source: itsmedinesh31.wordpress.com). Salesforce’s application logic knows, for each object, which Value columns to read for which fields. This is a form of pivoting or entity-attribute-value (EAV) model, but done in a constrained and performant way. Salesforce calls it “creative de-normalization and pivoting” in their architecture principles (Source: www.slideshare.net). It’s de-normalized in the sense that a single row holds values that could belong to different logical tables, and pivoted in the sense that values are rotated out of a strict columnar format into these generic columns.

All flex columns are defined as a generic data type (usually a VARCHAR text) in the actual database (Source: itsmedinesh31.wordpress.com) (Source: architect.salesforce.com). This is key: since a Value slot might hold a date for one field and a number for another field, Salesforce stores everything as a text and relies on conversion functions when retrieving or comparing values. Internally, Salesforce stores all values in a canonical string format and uses Oracle’s conversion functions like TO_NUMBER, TO_DATE as needed at query runtime (Source: itsmedinesh31.wordpress.com). It also applies appropriate validation on input – the platform will not allow a non-number to be put into a numeric field’s slot, etc., enforcing data type rules at the application layer (Source: www.packtpub.com). By using a universal type column, Salesforce avoids schema changes when new fields are added (the table already has, say, 500 flex columns available, and each new field just picks one) (Source: itsmedinesh31.wordpress.com). This design does mean that the database itself sees mostly strings, so native Oracle might not enforce type or length as strictly – Salesforce handles those via its own logic and metadata constraints.

The number of flex columns (N) is essentially a fixed schema design choice. As noted, Salesforce’s “one big table” (oft-called the Big Table, not to be confused with Google Bigtable) has on the order of a few hundred generic columns. Having hundreds of columns is unusual but supported by Oracle (Oracle can handle thousands of columns in a table) – Salesforce’s CTA exam study guide even points out that overly wide objects with hundreds of fields are acceptable in Salesforce’s use-case, whereas in normal database design you’d normalize or avoid that many columns (Source: www.packtpub.com). Salesforce is optimized for multi-tenant convenience over strict normalization; large objects with 300–500 fields exist and are supported by this model (Source: www.packtpub.com).

Example Illustration: Suppose two tenants: Org A has a custom object “Car__c” with fields: Make (Text), Model (Text), Year (Number), Price (Number). Org B has a custom object “Book__c” with fields: Title (Text), Author (Text), ISBN (Text). In a traditional separate-DB model, we’d have separate tables like A.Car__c(make, model, year, price) and B.Book__c(title, author, isbn). In Salesforce’s approach, both Car__c and Book__c records will reside in the single MT_Data table. Perhaps Car__c’s fields map to Value0=Make, Value1=Model, Value2=Year, Value3=Price (for Org A’s ObjID). Book__c’s fields might map to Value0=Title, Value1=Author, Value2=ISBN (for Org B’s ObjID). Internally, a Car record from Org A might look like (OrgID=A, ObjID=CarObjectID, Name=”Tesla X”, Value0=”Tesla”, Value1=”Model X”, Value2=”2020”, Value3=”95000”, …), and a Book record from Org B might look like (OrgID=B, ObjID=BookObjectID, Name=”Some Book”, Value0=”The Art of…”, Value1=”John Doe”, Value2=”1234567890”, Value3=NULL, …). They coexist in one table, but are virtually separated by OrgID + ObjID. The application knows that for ObjID=Car, Value2 should be parsed as a number (Year) etc., whereas for ObjID=Book, Value2 is a text (ISBN). This demonstrates the metadata-driven polymorphism of Salesforce’s storage.

The advantages of this approach are significant: every customer’s data model changes are just new rows in small metadata tables – no ALTER TABLE needed, and no separate physical tables to manage for thousands of orgs. It also means immediate propagation of schema: if a field is added, it’s available (virtually) instantly since the platform just starts using an unused Value column for it. On the flip side, this design places a lot of responsibility on Salesforce’s query engine layer to handle queries correctly and efficiently, since standard relational optimization can be tricky when one physical column is housing many different logical fields.

The following table summarizes some of the core system tables in Salesforce’s multi-tenant schema and their roles:

System TablePurpose in Salesforce Multi-Tenant Architecture
MT_ObjectsStores metadata for custom objects (virtual tables). Each row represents an object defined by a tenant, with fields like OrgID (tenant owner), ObjID (object ID), and ObjName (name of the object) (Source: itsmedinesh31.wordpress.com). This is part of the Universal Data Dictionary, mapping tenant-specific tables.
MT_FieldsStores metadata for custom fields on objects. Each row represents a field, with OrgID, the parent ObjID, FieldID, FieldName, data type, an IsIndexed flag, and FieldNum (the slot number assigned for storage) (Source: architect.salesforce.com) (Source: itsmedinesh31.wordpress.com). Together with MT_Objects, this defines the schema for all tenant objects.
MT_DataThe main data repository for all records of all custom objects (and many standard objects) across tenants. Contains generic columns (Value0…ValueN) to hold field values, plus identifiers (GUID, OrgID, ObjID) and housekeeping fields (Source: architect.salesforce.com) (Source: itsmedinesh31.wordpress.com). Each row corresponds to a record of a certain object of a certain org, with that object’s field values stored in specific Value columns per metadata mapping.
MT_ClobsStores large text (CLOB) field data that doesn’t fit in the main MT_Data row. If a record has a long text field, the content is stored here (out-of-line) and linked to the record, to keep MT_Data optimized (Source: itsmedinesh31.wordpress.com).
MT_IndexesA pivot index table for non-unique indexes on fields. It stores copies of field values (in typed columns e.g. StringValue, NumberValue, DateValue) for fields that are marked as indexed (Source: architect.salesforce.com) (Source: architect.salesforce.com). This table has regular database indexes on those typed columns, allowing efficient searches. It’s essentially a secondary index structure for the EAV data in MT_Data.
MT_Unique_IndexesA pivot index table for unique fields (Source: architect.salesforce.com). Similar to MT_Indexes, but with unique indexes on the combination of Org + field value, enforcing uniqueness constraints for custom fields that require unique values (Source: architect.salesforce.com).
MT_Fallback_IndexesA table supporting fallback searches. It stores records’ Name values (and perhaps other key info) to facilitate global search queries when the primary search engine is unavailable (Source: architect.salesforce.com). If the external full-text search fails, Salesforce can query this table to find records by Name across multiple objects without doing full table scans (Source: architect.salesforce.com).
MT_Name_DenormA denormalization table for names. It stores just the ObjID and Name of each record (Source: architect.salesforce.com). This helps quickly retrieve the name of a related record (for example, showing a parent record’s name in a lookup field) without joining the entire MT_Data table. It’s essentially a lightweight lookup for record names by ID.
MT_RelationshipsA pivot table to optimize joins for relationship fields (Source: www.oreilly.com) (Source: architect.salesforce.com). When an object has a lookup or master-detail field (i.e. a foreign key to another object’s record), the raw data stores the foreign key ID in a Value slot. The Relationships table duplicates necessary info to allow efficient traversal in both directions (e.g., find all children for a parent, or confirm a parent-child link exists) using indexed OrgID+IDs. This helps Salesforce run SOQL join queries (especially for parent-child relationships) without expensive self-joins on MT_Data.
MT_History (Audit Trail)Although not explicitly named above, Salesforce also maintains internal history/audit tables. When Field History Tracking is enabled for a field, changes are recorded in a history table (an internal pivot table that stores changes with old value, new value, date, etc.) (Source: architect.salesforce.com). This allows retrieval of field change history. There are likely separate history tables per object or a combined history store keyed by record.

(Table: Core internal tables in Salesforce’s multi-tenant data architecture and their functions. “MT” stands for multi-tenant; some table names are simplified for clarity as per Salesforce’s documentation.)

Together, these tables and structures fulfill the role of what would be separate tables, indexes, and relationships in a conventional single-tenant schema. The MT_Indexes table, for instance, exists because you cannot simply create a normal SQL index on MT_Data’s Value columns for a specific field – each Value column holds data for many fields across orgs. The platform’s solution is to synchronously copy any field marked as indexed into the MT_Indexes table, into the appropriate typed column, so that an Oracle index can be built on that column (Source: architect.salesforce.com) (Source: architect.salesforce.com). For example, if “Invoice.Amount__c” is indexed, whenever an Invoice record’s Amount changes, the platform inserts or updates a row in MT_Indexes with OrgID, ObjID, RecordID, and NumValue = the amount (since it’s a number). Oracle then can efficiently index NumValue. A search like SELECT * FROM Invoice WHERE Amount__c = 100 under the hood becomes a query on MT_Indexes (NumValue=100 AND matches that field’s index key) to fetch candidate RecordIDs, which then map to MT_Data rows. The custom query optimizer in Salesforce’s engine uses these pivot tables to speed up data retrieval (Source: architect.salesforce.com) (Source: architect.salesforce.com).

Similarly, MT_Unique_Indexes ensures uniqueness: if a field must be unique, its values (for each record) are copied to this table and Oracle’s uniqueness constraint on that table will throw errors if duplicates are inserted (Source: architect.salesforce.com). This solves the problem that the main data store can’t itself enforce uniqueness easily across the multi-tenant flex storage.

The Relationships table is particularly interesting. When you declare a relationship field (say a lookup from Contact to Account), Salesforce will map that to a Value slot (storing the foreign key ID). But to optimize joins (like retrieving all Contacts for an Account), Salesforce maintains the Relationships pivot with composite indexes (Source: www.oreilly.com) (Source: architect.salesforce.com). According to an O’Reilly book on Force.com’s architecture, the Relationships table has two unique composite indexes: likely one on (OrgID, parentID, childID) and one on (OrgID, childID, parentID) to allow traversing in both directions efficiently (Source: www.oreilly.com). In SOQL queries, one can traverse relationships easily (e.g., SELECT Account.Name, Account.Industry, (SELECT Name FROM Contacts) FROM Account), and the platform under the hood uses the Relationships table to quickly find related children without doing a brute-force search of MT_Data.

Example of a Query Flow

To cement understanding, let’s walk through how Salesforce might process a simple query, for example: “Find all Accounts in Org X where Industry = 'Finance' and list their Account Name and Owner’s name”. In pseudo-SOQL this might be: SELECT Name, Owner.Name FROM Account WHERE Industry = 'Finance'. Internally:

  1. Parsing & Metadata Resolution: The platform sees the context of Org X and the object “Account”. It looks up Org X’s Account object definition in MT_Objects (finding the ObjID for Account) and then finds the FieldNum for “Industry” and “Name”, and sees that “Owner” is a relationship to User object. Let’s say Industry is FieldNum 12 for Account, Name is the standard name field. The query is essentially “WHERE Account.Industry__c = 'Finance'”.

  2. Index usage: If “Industry” is marked as indexed (many picklist or text fields like that might be, especially if used in filters), the platform will consult MT_Indexes. It will take the filter 'Finance', run it through its case-folding normalization (Salesforce indexes strings in a case-insensitive way by default) (Source: architect.salesforce.com), and query MT_Indexes for OrgID = X, ObjID = (Account’s ObjID), field = Industry’s FieldID perhaps, and StringValue = 'finance' (normalized). Because MT_Indexes.StringValue is indexed, Oracle quickly returns all matching entries (which contain RecordIDs of Account records where Industry = Finance) (Source: architect.salesforce.com) (Source: architect.salesforce.com). The platform then fetches those specific records from MT_Data by their primary key (which likely is the GUID).

    • If Industry was not indexed, the system would either do a full scan on MT_Data partition for Org X (less ideal but possibly mitigated by partition pruning, see next section) or, more often, it might offload this query to the full-text search engine if it’s a user search. But since this is a deterministic filter in a SOQL query, if not indexed, Salesforce’s query optimizer might simply deem it too expensive and throw an error or limit if the data volume is huge (one reason for index optimizations and query selectivity checks – unselective queries may be forbidden). There’s also mention of a fallback mechanism: if an index isn’t available and it’s a global search scenario, they could use MT_Fallback_Indexes on Name fields, but for a structured SOQL query like this, usually one ensures the field is indexed or uses a selective filter. It’s worth noting that Salesforce will prevent extremely non-selective queries from running to protect performance (Source: architect.salesforce.com) (Source: architect.salesforce.com).
  3. Data retrieval and join: Once the matching Account records are identified, Salesforce needs to retrieve Name and Owner.Name. Name is stored directly in the Account record (likely also stored redundantly in MT_Name_Denorm for quick access if needed, but it can get it from MT_Data’s Name column too). The Owner is a lookup relationship to a User record (the user who owns the account). Salesforce will have the OwnerId as one of the fields on Account (likely stored in a Value slot, or for standard objects possibly a dedicated column, but in the multi-tenant system it works similarly). To get Owner.Name, the platform can use the Relationships table or the fact that it knows the user IDs. Likely, it will collect all the OwnerId values from those Accounts, then query the User object (which might be a global—or at least org-specific—user table) for those IDs. Standard objects like User might not be fully in the generic system (Salesforce historically has had some standard tables), but conceptually one can imagine it using the same approach: a query to get User Names for the given IDs, possibly using an index on user names or directly by primary key.

  4. Partition Pruning: Because OrgID is part of every query, the database can take advantage of physical partitioning. Salesforce partitions all its big tables by OrgID at the database level (Source: architect.salesforce.com). This means when retrieving records for Org X, Oracle will prune to only those partitions containing Org X’s data, rather than scanning the whole table (Source: architect.salesforce.com). Partitioning thus improves performance and also maintainability (smaller partitions are easier to manage/backup than giant monolithic tables). We will discuss the partitioning strategy in the next section.

  5. Result assembly: The records are assembled, the Owner.Name values attached for each, and the results returned to the caller. At runtime, Salesforce’s engine has to dynamically construct the SQL join or separate queries to fetch that related data, because the schema is dynamic. But since every org uses the same underlying schema, Salesforce can use prepared statements or code that just binds the OrgID and other parameters.

From the above, it’s evident that Salesforce’s architecture heavily relies on custom application logic to make the multi-tenant data model behave like normal SQL. The actual Oracle database sees queries against MT_Data and MT_Index tables with OrgID filters and so on. Salesforce’s “custom query optimizer” takes high-level requests (SOQL queries) and plans them using the pivot tables and meta knowledge to ensure the queries remain efficient (Source: architect.salesforce.com). Over time, Salesforce has refined this and even added features like selective indexing, skinny tables, and optimizer hints to handle edge cases (more on these later).

No Runtime DDL – Why and How

One of the founding principles mentioned earlier is “no Database Definition Language at runtime” (Source: www.slideshare.net). This means after the system is deployed, Salesforce doesn’t execute CREATE TABLE or ALTER TABLE for customer-specific changes. All tenant provisioning and customization is done via data operations (INSERT into MT_Objects, etc.). This is extremely important for multi-tenancy: allowing arbitrary DDL by tenants would not only be a security risk, but would also fragment the shared infrastructure. By disallowing DDL and funneling everything through a controlled metadata layer, Salesforce ensures stability and predictability in the database schema. It also means all customers run on the exact same schema structure (the MT_Data table and friends), just with different content. The benefit is huge when it comes to pushing platform-wide upgrades – Salesforce can modify the core schema (like adding a new version of a pivot table, or new columns to MT_Data as needed in a controlled way) at most a few times in a release, rather than dealing with thousands of custom varied schemas.

For example, when Salesforce introduced new features that required additional metadata or flags, they could add a column to a metadata table or add a new pivot table, and that immediately serves all orgs. If instead each org had its own tables, an upgrade might mean altering 100,000 databases – clearly not feasible on a tight schedule. The multi-tenant single schema approach elegantly side-steps that.

Salesforce’s design also allows online schema evolution in many cases. If an admin in Org X changes a field’s data type (say from picklist to text), Salesforce doesn’t go and alter an Oracle column (since physically it’s still a text in a flex column anyway). But the platform may need to migrate existing values to a new format or slot. The documentation describes that if a picklist (which might have been stored with some lookup to picklist labels) is converted to text, Salesforce will allocate a new flex slot for that field, copy the data over in the background, then update metadata to point to the new slot (Source: architect.salesforce.com) (Source: architect.salesforce.com). All of this happens while the system is live, and users can continue to work – they might not even notice except perhaps a slight delay in seeing the updated field type. This operational flexibility is a direct consequence of having that abstraction layer. In a normal DB, altering a column type might lock the table or require downtime; in Salesforce, it’s handled as a background data migration with minimal impact (Source: architect.salesforce.com) (Source: architect.salesforce.com).

Another scenario: adding a roll-up summary field (a field that shows aggregate value from a child object, e.g. total Opportunities sum on an Account). Normally, you’d perhaps create a trigger or a computed column. Salesforce instead asynchronously computes such derived values in the background and stores them once ready (Source: architect.salesforce.com). The architecture had to incorporate not just storage but also mechanisms for these computed values and cross-object calculations – typically done by additional internal jobs and stored in either the same data table or separate ”summary” tables.

In summary, the multi-tenant schema and metadata approach taken by Salesforce was a groundbreaking solution to the multi-customer SaaS problem. It prioritized flexibility and upgradeability over raw adherence to relational normalization. Everything is effectively one big (though partitioned) data model. This required innovative solutions (as we saw with pivot tables for indexes and relationships) to meet performance and integrity requirements. In the next sections, we examine how Salesforce handles data partitioning, scaling, and the underlying database engine optimizations that make this practical in production, as well as how they maintain strong security isolation and performance safeguards in such a shared environment.

Database Engine and Partitioning Strategy

Salesforce’s choice of database engine and the way it partitions data are crucial to understanding its architecture. As noted, Salesforce has long used Oracle Database as the core engine to store its multi-tenant data (Source: www.techtarget.com) (Source: www.techtarget.com). Oracle’s enterprise capabilities (transactions, locking, indexing, partitioning, etc.) have been leveraged to implement Salesforce’s design. Let’s break down two key aspects here: the database engine (Oracle and related tech) and the partitioning/sharding approach Salesforce uses for scalability.

The Database Engine: Oracle and RDBMS Features

Why Oracle? In the early 2000s, Oracle was the market leader known for reliability at scale. Salesforce’s entire platform trust model relied on never losing customer data and maintaining high uptime. Oracle provided proven features for backup, replication, and ACID compliance. Additionally, Oracle has advanced features like table partitioning, bitmap indexes, function-based indexes, parallel query, etc., which Salesforce engineers could use to optimize performance for multi-tenant usage (Source: www.slideshare.net) (Source: architect.salesforce.com). Using Oracle also allowed Salesforce to focus on building the multi-tenant abstraction rather than building a database from scratch. However, this decision also meant paying significant licensing fees and being somewhat beholden to a competitor. Over the years, this tension was notable: as of 2013 Salesforce signed a 9-year deal to continue using Oracle, likely a “nine-figure” expenditure (Source: www.zdnet.com) (Source: www.zdnet.com), while also hiring open-source DB experts to explore alternatives (Source: www.zdnet.com). Oracle’s Larry Ellison frequently boasted that Salesforce “will never get off Oracle” and continues to run fully on Oracle DB (Source: www.techtarget.com). As of 2018, Salesforce was indeed still on Oracle for its core data, though the company has acquired many database technologies (PostgreSQL via Heroku, NoSQL via Martin (Redis) or other acquisitions, etc.) for peripheral parts of its ecosystem (Source: www.zdnet.com).

From an internal perspective, running on Oracle allowed Salesforce to use many RDBMS optimizations:

  • Hash Partitioning: Salesforce uses Oracle’s native partitioning to physically separate data by OrgID (Source: architect.salesforce.com). In practice, the large multi-tenant tables (like MT_Data, MT_Index, etc.) are likely hash-partitioned on OrgID across multiple partitions or even tablespaces. This means each table is split into partitions such that any operation with an OrgID filter can be limited to a subset of the data (partition pruning) (Source: architect.salesforce.com). According to Salesforce, “all the platform data, metadata, and pivot table structures… are partitioned by OrgID using native database partitioning mechanisms” (Source: architect.salesforce.com). This is a common technique to manage very large tables. Instead of one gigantic index on the whole table, each partition has its own index, and queries that specify OrgID only need to search the relevant partition. Partitioning also helps in maintenance tasks: for example, if Salesforce ever needs to move an org to a different instance, having data partitioned by Org might make it easier to extract that partition.

    It’s not explicitly stated whether Salesforce uses one partition per Org or uses hashing to group many OrgIDs into each partition. Given there are hundreds of thousands of orgs, it’s more likely they define (for example) 1024 hash partitions; each OrgID hashes to one of those. That way the number of partitions is manageable, and as the query arrives with OrgID, Oracle’s hash algorithm immediately narrows it down. The phrase “hash partitioned by OrgId” reflects this (Oracle hash partitioning uses a hash of the key to assign a partition) (Source: www.slideshare.net). This design strikes a balance: one large org’s data might still all sit in one partition, but Oracle can parallelize queries across partitions if needed, and a small org’s data doesn’t end up fragmented all over. The goal of partitioning is improved query performance and manageability (Source: architect.salesforce.com), and Salesforce reports that because every query inherently includes OrgID, they naturally benefit by only touching that org’s partition (Source: architect.salesforce.com).

  • Smart Primary Keys: Salesforce generates its record IDs (GUIDs) in a way that encodes information (the first 3 characters of a Salesforce ID indicate object type, etc., and the IDs are base-62 encoded). There is some evidence Salesforce uses “smart primary keys” and possibly cluster keys to optimize IO (Source: www.slideshare.net). For example, records might be physically clustered by OrgID in storage. Oracle’s Index-Organized Tables or reversed key indexes could be used to distribute inserts. We know Salesforce had to ensure that when one org is inserting records, it doesn’t contiguously lock a hotspot in an index needed by others. Techniques like using a composite primary key (OrgID, RecordID) or hashing the primary key can avoid hot spots. The slide mention of “Smart Primary Keys, Polymorphic Foreign Keys” (Source: www.slideshare.net) suggests Salesforce carefully designed how IDs are structured. Polymorphic foreign keys refer to relationships where the target can be of multiple types (Salesforce allows a field to reference different object types – e.g., a task’s “WhatId” can point to either an Opportunity or a Case, etc.). They handle this with an ID convention that encodes object type in the ID, making it feasible to have a single foreign key field that can reference different tables, and likely not requiring separate lookup tables for each type because the ID itself reveals which object the foreign key is to.

  • Use of Every Optimization: Salesforce claims to “use every RDBMS feature & optimization” it can (Source: www.slideshare.net). Over the years, that likely includes things like bind variables (to reuse execution plans), caching (pinning certain tables in memory perhaps), parallel execution for certain analytic queries or big batch jobs, materialized views or indexed views for some summary data, etc. For search, they integrated with external engines (e.g., initially Lucene/Solr for full-text search indexes (Source: highscalability.com). For read performance, Salesforce introduced caching layers: e.g., they employ memcached for some caching of session or reference data (Source: highscalability.com) (the High-Scalability article notes memcache usage). But notably, the core transactional data is always read-from and written-to the database – app servers don’t cache business data between requests in a way that could get stale. They may cache metadata heavily (as described) and maybe some record data for repeated access within a single transaction, but Salesforce app servers are basically stateless across requests (Source: www.slideshare.net). This means the database and its buffer cache remain the primary source for query results, making Oracle’s scalability and tuning absolutely critical.

  • ACID Transactions and Concurrency: Oracle’s proven concurrency control allows Salesforce to have many thousands of users hitting the same logical tables. Standard Oracle row-level locking ensures that two users updating different records generally don’t conflict, even if those records are in the same table (MT_Data). Contentions can occur if, say, two processes try to update the same record or if there’s a need for table-level locks, but Salesforce’s application design minimizes such occurrences. The use of bulk API and bulk triggers means Salesforce often batches operations to reduce overhead, but at the DB level those still translate to standard commits. Salesforce needed to fine-tune things like max number of connections, transaction log (redo) throughput, etc., to handle peaks of activity. They reported achieving 24,000+ database transactions per second at peak back in 2013 (Source: highscalability.com) (Source: highscalability.com), which is a staggering number. To manage that, they likely use a combination of extremely robust hardware and efficient software patterns (e.g., avoiding superfluous round-trips, using batch commits, etc.). Oracle’s ability to handle high transaction volume (with features like redo log mirroring, etc.) is key.

  • Backup and Replication: Salesforce runs a highly reliable service, so backup and replication are critical. Historically, they likely used Oracle’s Data Guard for maintaining a hot standby database in a remote data center (for disaster recovery). Indeed, on their Trust site, Salesforce indicates each instance has a mirrored pair in an alternate location for DR, and they practice failovers. In case of serious issues, they can switch an instance to its replica. For example, an infamous incident in 2016 saw NA14 instance suffer a database failure that corrupted files; Salesforce had to failover to a backup and even then some data was lost (about 3-4 hours of data that couldn’t be recovered) (Source: www.infoworld.com) (Source: www.theregister.com). That incident shows that even with enterprise tech, failures happen – a storage tier issue caused data corruption, and the failover did not have those last hours of data. Salesforce since improved their backup strategies (e.g., implementing near-real-time replication and periodic read-only snapshots). Oracle’s robust backup features (RMAN, etc.) are surely in play to get nightly full backups and transaction logs, etc. Additionally, with each release, Salesforce had to ensure schema changes did not break replication or backup consistency. The adoption of Hyperforce (public cloud) in recent years likely uses cloud-native storage snapshots and multi-AZ replication for resilience, but conceptually it’s similar principles – ensuring data is copied to multiple locations to prevent loss.

  • Platform as a whole – external tools: It’s worth noting that not everything in Salesforce uses Oracle in the same way. For example, the search index (global search box that can find text in multiple objects) has long been powered by an external search engine. Initially Salesforce used an in-house search based on Lucene (project code-named “Galahad”), later moving to Apache Solr/other technologies (Source: highscalability.com). The MT_Fallback_Indexes table we described is a safety net when that search engine fails (Source: architect.salesforce.com) (Source: architect.salesforce.com), implying normally text search doesn’t hit the core DB for every query. Instead, the text engine asynchronously indexes data from the DB. Another example: File storage (attachments, documents) – Salesforce eventually moved binary large objects out of the core DB and into a separate storage system (possibly network file storage or object store). They introduced features like ContentVersion and content storage on AWS S3 for some products. This alleviates the main DB from serving heavy file data, which is beneficial since databases are not the most efficient place for large binaries. While these are lateral to the core DB design, they reflect architectural decisions to offload certain workloads away from the primary database to keep it performing well on what it’s best at (structured data with transactions).

In short, Salesforce’s use of Oracle is far from vanilla – they push it to its limits. The platform uses advanced features (partitioning, indexing strategies, caching, parallel execution) as needed. Also, because all tenants share the same DB schema, Salesforce can invest significant effort in tuning just that one schema for optimal performance. The indexes on pivot tables, the partition layout, even physical storage parameters (initrans, pctfree, etc.) can be optimized once and benefit all customers. In contrast, if each customer had separate databases, optimizing each would be infeasible. This is a big win of multi-tenancy: one big performance tuning problem instead of ten thousand small ones. Of course that one is a very big problem, but Salesforce has DBAs and engineers dedicated to it. They also have built internal monitoring (site reliability engineering) to track query performance and catch inefficient queries caused by custom code, etc., and they use the governor limit system to keep any one tenant’s poorly performing code from overwhelming the database.

Horizontal Scaling: Instances and Pods

Even the best vertical scaling has limits. Salesforce can scale an Oracle instance up (bigger machines, better IO, etc.), but at some point, they scale out by having multiple instances (pods) to split the load. An “instance” in Salesforce terminology is basically a set of infrastructure that runs an independent copy of the application stack and database, serving a subset of customers (Source: highscalability.com). For example, “NA14” or “EU5” are instance identifiers – NA14 is one production instance (in North America region, number 14). Salesforce assigns each new customer org to one of these instances. Each instance has its own database (or DB cluster) containing the orgs assigned to it. There isn’t cross-instance sharing of data in real-time; if two companies use Salesforce and are on different pods, their data is in separate DBs. This is how Salesforce shards its overall load: by org. They essentially shard by tenant, not by random data ranges. This is a common approach in multi-tenant SaaS – once one database can’t handle more organizations well, you start a new one and direct new customers there, or even migrate some orgs over to balance.

According to a 2016 architecture overview, Salesforce had 50+ production instances, each with one primary data store (Source: www.slideshare.net). By now that number could be higher (especially with Hyperforce allowing deployment in new regions). Each instance can handle thousands of orgs; bigger customers or very data-heavy orgs might be strategically placed so that no one instance has too many giant tenants. Salesforce also has the concept of “Superpods”, which are collections of instances sharing certain infrastructure (like network and SAN) but isolated from other superpods (Source: highscalability.com). This provides isolation: a failure in one superpod shouldn’t take down instances in another, etc.

When a Salesforce instance reaches capacity (whether by storage, or CPU load, etc.), Salesforce can perform an Org Split or Migration – moving some orgs to a different instance to distribute load (Source: brainiate.show). They do this carefully to minimize disruption (using maintenance windows and data copy). As an example scenario, if instance NA14 has grown to host thousands of orgs and is hitting memory limits, Salesforce might migrate a set of orgs to a brand new instance NA51. Tools and processes exist internally to export an org’s data and import it to another database, while preserving IDs and relationships.

It’s important to clarify: Within one instance’s database, data is not further sharded by content – it’s all in that one Oracle (albeit partitioned by OrgID). Salesforce historically did not split a single org’s data across multiple databases (no multi-db cluster serving one org’s table horizontally partitioned by record). All data for an org lives in one Oracle instance for consistency. However, with extremely large data (billions of records), Salesforce has introduced Big Objects and other strategies which might internally store data outside the core DB (we’ll cover Big Objects soon). But for CRM data, one org = one instance’s DB.

The combination of vertical scaling (powerful hardware, Oracle optimizations) and horizontal scaling (multiple instances) has allowed Salesforce to grow transaction volumes enormously. For example, by 2017-2018, they were likely handling several billion transactions per day (1.3 billion/day was reported in 2013 (Source: highscalability.com); given growth, it could be an order of magnitude more now). Each instance is like a “cell” that carries a portion of that total load. This architecture resembles a sharded architecture (shard by tenant). As a Salesforce Engineering blog humorously put it, for some systems (like multi-tenant CRM) sharding by tenant is straightforward – “picture a swimming pool with lanes: you can divide up the users because they generally stay in their lanes (tenants are mostly independent)”, whereas some other apps (like social networks) can’t shard cleanly (Source: developer.salesforce.com) (Source: developer.salesforce.com). Salesforce’s application is naturally tenant-isolated in usage, so this works well.

Data Partitioning Details

Within a single instance’s database, we discussed partitioning by OrgID at the table level. In Oracle, one can have range/list partitions or hash partitions. If Salesforce used list partitioning per OrgID, adding a new Org would mean altering the partition scheme to include that Org – too much overhead given new orgs spin up daily. So hash partitioning is the likely approach for automatic distribution (Source: architect.salesforce.com). Oracle can hash the OrgID to, say, 128 partitions. Then if some partitions become very skewed (imagine one Org has 90% of data landing in one partition because it hashes to itself), an admin could use subpartitioning or accept it as is. Often the aim is that each partition holds many orgs’ data, so each index at partition level is smaller, and queries for one Org only hit one partition’s index. This yields near linear scaling as more orgs add more data – they fill more partitions but queries remain confined.

It’s worth mentioning that Salesforce also has a rarely used feature called “Divisions” at the org level to partition data within a single org for performance. An org with tens of millions of records could enable “Divisions” to logically segment records (e.g., by region or business unit). This adds a hidden “Division” field to records and the platform can include it in queries to narrow scope, giving some performance benefit similar to partitioning within that org’s data (Source: bluecanvas.io). However, divisions are an optional/advanced feature, often overshadowed by better hardware or indexes, so it’s not common unless an org is extremely large in data volume.

To summarize partitioning: At the highest level, Salesforce partitions by tenants into multiple instances (each with its own DB). Within each instance’s DB, it partitions tables by OrgID to boost query performance and manageability (Source: architect.salesforce.com) (Source: architect.salesforce.com). This combination ensures that when an org uses Salesforce, their data access is mostly hitting a smaller slice of the total data, thereby reducing contention with other orgs’ data access. The result is that most operations are “shared-nothing” at the tenant level – i.e., Org A’s transactions mostly touch Org A’s partitions and don’t lock or scan Org B’s data. The Oracle engine thus concurrently serves multiple orgs’ requests, each operating in different partitions (both at the table and index level), which is analogous to serving many databases at once but within one engine. This design choice was a cornerstone for achieving multi-tenant scalability and is explicitly noted: “every platform query targets a specific org’s information, so the optimizer need only consider partitions containing that org’s data, rather than an entire table” (Source: architect.salesforce.com).

High Availability and Data Replication

Though not the focus of the original question, it’s worth noting how Salesforce keeps the database highly available as part of architectural decisions. Salesforce promises something like 99.9% uptime on its core services. To reach this, they use a mix of redundant infrastructure and failover tactics:

  • Redundant Data Centers: Each instance is typically replicated to a secondary data center. If the primary DC has a catastrophic failure, Salesforce can failover the instances to the secondary. This is a “warm standby” model – not active/active, but active/passive with replication.

  • Database Replication: Using Oracle Data Guard or equivalent, changes from the primary database are streamed to a standby database in near-real-time. If the primary fails, the standby can be opened (possibly with some data loss depending on last sync). The 2016 NA14 outage indicated a failover had to be done and some data (the last few hours) couldn’t be recovered from logs (Source: www.theregister.com). After that painful lesson, Salesforce likely improved to reduce RPO (Recovery Point Objective) to near zero, possibly by using synchronous replication to the standby (which can impact performance slightly, but for critical data it might be worth it) or by supplementing with incremental backups.

  • Multi-AZ Deployments in Hyperforce: With the move to Hyperforce (Salesforce on public cloud like AWS), they have emphasized multi-availability-zone design – meaning the database and other components are deployed across at least 3 AZs with redundancy (Source: engineering.salesforce.com) (Source: engineering.salesforce.com). In practice, this could mean using cloud-managed database replication or running a distributed database cluster across AZs. For example, on AWS, they could use Amazon’s database services or continue with Oracle by running Oracle RAC across AZs (though RAC over AZ is non-trivial because of latency). They might instead use an approach of one primary in AZ1, a synchronous standby in AZ2, and an async standby in AZ3. The key point is eliminating single points of failure.

  • Stateless App Tier: Because the app servers are stateless (all important data and session state is stored in DB or caches), Salesforce can restart or reroute around app server issues easily. Load balancers distribute requests and any app server can serve any org’s requests (though often an org is “pinned” to a set of app servers for cache locality). If one server dies, others pick up seamlessly. This architecturally complements a highly available DB: the app tier can be scaled horizontally and survived failures; the DB is the only place state lives, so it must be protected with redundancy.

  • Backup and Recovery: Salesforce performs regular backups. They historically offered customers backup extracts (and now offer a native backup and restore service) – but internally, they have their own backups to be able to restore data if needed. They’ve used those rarely (the NA14 incident was one where they tried to retrieve some lost data from backups and partial logs). The backup strategy likely includes daily full backups and continuous archiving of transaction logs. On Oracle, they might use RMAN to back up to disk/tape nightly, etc. Now on public cloud, they might use cloud storage snapshots for quicker recoveries.

Salesforce’s engineers have shared principles for high availability that include systematic practices like redundancy, automated failover, and minimizing recovery time (RTO) and recovery point (RPO) (Source: engineering.salesforce.com) (Source: architect.salesforce.com). The fact that a single instance’s outage affects many customers means they have to be extremely careful and quick in handling issues. Indeed, the direct business impact of downtime is huge, so a lot of engineering goes into resilience.

In conclusion of this section, Salesforce’s internal use of the database and partitioning is a story of maximizing the strengths of a relational DB for multi-tenant use. By partitioning by tenant and heavily indexing and caching, they mitigate the performance concerns of putting many tenants’ data together. By relying on Oracle’s maturity, they sidestepped building custom transaction or replication logic – Oracle handles that. The result is a system where the database is truly the “system of record” at massive scale – a phrase directly emphasized by Salesforce (“Database system of record” is one of their key architectural principles) (Source: www.slideshare.net). Unlike some modern web architectures that might use eventual consistency or NoSQL for scale, Salesforce stuck with a relational, consistent model – because it’s crucial for enterprise business data to be correct in real-time. They then layered creative approaches on top to accommodate multi-tenancy without losing those guarantees.

Security, Isolation, and Multi-Tenant Resource Management

One of the biggest challenges of a multi-tenant database is ensuring that tenants are both securely isolated (no data leakage or unauthorized access across orgs) and fairly isolated in terms of resource usage (one tenant can’t degrade service for others). Salesforce has multiple layers of isolation:

Data Security and Access Controls

At the most basic level, the separation of data by OrgID in all queries is the enforcement mechanism for data isolation. The application ensures every query filter includes the Org’s identifier, so that an Org can never access data that doesn’t have its OrgID (Source: architect.salesforce.com) (Source: architect.salesforce.com). This is baked into the platform; even if a user tries to write a cross-org SOQL query (which they can’t, because the language and API don’t allow you to specify another Org’s ID explicitly), the system wouldn’t let it through. The combination of the multi-tenant data model and the platform’s query compiler means it’s practically impossible for one org to retrieve another org’s records – it would require a bug at the Salesforce platform level, which to its credit has had a strong record of preventing such breaches.

Salesforce also goes beyond just logical Org separation. They implemented per-org encryption keys for encryption-at-rest in some editions (Source: www.slideshare.net). With a feature called Platform Encryption, customers can have their data encrypted in the database with keys that are specific to them. The slide snippet referencing “Per Org encryption keys” suggests that each org’s data can be encrypted with a unique key, so even in the unlikely event that someone somehow accessed raw data files, they’d still have tenant-specific encryption preventing broad exposure. This encryption is applied at the application level (Salesforce uses a deterministic encryption scheme for certain fields so that indexing can still work in some capacity). While encryption is optional and not all data is encrypted (due to performance and feature trade-offs), it demonstrates further tenant-level isolation for those who need it (e.g., compliance requirements).

On top of tenant-to-tenant isolation, Salesforce has a robust internal security model within an org (roles, profiles, field-level security, sharing rules, etc.), but that’s out of scope of internal DB architecture (though some parts, like row-level security, do affect queries: e.g., sharing rules add extra filters to queries automatically for which records a user can see). Those are implemented in the application layer for each query, rather than using DB GRANTs or such.

The Salesforce Trust and Compliance teams perform regular security reviews. From a DB perspective, one interesting aspect is how multi-tenancy interacts with data privacy: all customers share the same DB processes, so Salesforce must ensure no process dumps memory or logs that could have another org’s data. They likely use secure coding practices to avoid, for example, SQL injection (SOQL is a limited language and user inputs are parameterized), and DB user separation – perhaps all orgs’ data is under one Oracle schema user anyway, but internal access to that is tightly controlled.

In short, Salesforce’s architecture has proven very secure in segregating tenant data. In ~20+ years, there haven’t been known incidents of one org accidentally accessing another’s data due to a flaw in the DB design. This is a testament to the careful design around OrgID and the thorough testing.

Governor Limits and Fair Usage

While data access is isolated by design, resource usage on the shared platform must also be controlled. Salesforce addresses this with an extensive set of governor limits – effectively quotas and ceilings on resource consumption per transaction or per org, at the application server level. Some key governor limits include:

  • Limits per transaction (execution context): e.g., maximum 100 SOQL queries in a single Apex code execution, maximum 150 DML (insert/update) operations, maximum CPU time of 10,000 ms, maximum heap memory of 6 MB, maximum 50,000 records fetched in a query, etc. These prevent any single transaction (like a badly coded trigger or batch) from running away and hogging the server or DB (Source: architect.salesforce.com) (Source: architect.salesforce.com).
  • Limits per 24-hour period: e.g., an org can make only so many API calls per day (depending on licenses), or can execute at most so many batch jobs, etc. This stops abuse like a script mass extracting data continuously.
  • Concurrent limits: e.g., max 10 long-running queries at a time for an org, or max number of concurrent Apex threads. These ensure one tenant doesn’t saturate all available threads or DB connections.

These governors are enforced by the runtime engine – if a limit is exceeded, the transaction is halted with an error. For example, if an Apex trigger tries to query 1 million records without selective filters (exceeding 50k return limit), it will throw a runtime exception rather than drag the database through a giant query (Source: www.packtpub.com) (Source: architect.salesforce.com). Similarly, if a SOQL query’s filter is so unselective that it would need to scan too much data, Salesforce’s optimizer might proactively not allow it (the error message “Query is either selective against large dataset or it’s attempting to access too much data” is something developers occasionally see).

From the internal perspective, these limits create backpressure to developers and integrations to behave efficiently, thus protecting the database. They are a direct consequence of multi-tenancy: in a single-tenant system, if the customer writes a lousy query, only they suffer. In Salesforce’s multi-tenant world, a lousy query could affect others by consuming disproportionate DB time or memory, so Salesforce has to disallow or terminate it. As the docs say, these limits “might sound restrictive, but they are necessary to protect the overall scalability and performance of the shared system… and in the long term, they promote better coding techniques” (Source: architect.salesforce.com) (Source: architect.salesforce.com). Indeed, Salesforce developers have become accustomed to writing code that batches operations and queries selectively.

Additionally, Salesforce monitors org usage patterns. Extremely heavy orgs (those hitting limits often or handling very large data) are flagged, and sometimes Salesforce will work with those customers on performance optimizations or suggest purchasing additional capacity. They even have a concept of “Large Data Volumes” (LDV) best practices published to guide customers once they cross certain record count thresholds (e.g., use archiving, indexes, avoid certain operations). We will see some solutions to LDV next (like Skinny Tables and Big Objects).

Another mechanism: Multi-tenant resource allocation in queries. Salesforce’s custom query optimizer can not only choose an index but also decide to abort a query that is making the system thrash. If a query plan would require reading too many records (say an unindexed filter on a 50 million row object), the platform might terminate it to keep the database healthy, returning an error to the user. This is unusual compared to a normal DB (which would just try to execute and maybe slow down) – but it’s an example of how the software above the DB intervenes to maintain overall health. In effect, Salesforce does cost-based policing. They haven’t publicly disclosed the exact thresholds (they likely consider factors like an index selectivity threshold, etc.), but it’s known to developers that if you don’t have selective filters on big objects (usually meaning <10% of rows target, or indexed fields), you can hit a runtime exception.

Isolation of execution: Salesforce runs all custom code (Apex) on a multi-tenant runtime as well. The Apex runtime enforces those governor limits and also ensures memory and CPU are metered per org execution. They even restrict things like infinite loops or excessive callouts. So from the DB side, one org’s code can’t hog a whole core indefinitely – it would get forced stop by the platform after consumption crosses the limit.

Test and Deployment isolation: Salesforce also ensures that when new custom code is deployed, it is tested not to break multi-tenant performance. They require 75%+ code coverage by tests in an org to deploy Apex code, and when those tests run, Salesforce monitors that they don’t exceed limits or do anything dangerous (Source: architect.salesforce.com) (Source: architect.salesforce.com). This deployment validation helps catch inefficient code early. In some cases, Salesforce’s Tech support and CEs proactively reach out to orgs that have scripts causing timeouts or heavy DB load to help optimize them.

In essence, governor limits act as circuit breakers to protect the shared database. They are vitally important internal “rules of the road” in Salesforce’s multi-tenant engine. While sometimes chafed at by developers (because no one likes their code being told “no, you can’t do that large query”), these limits are arguably one of the reasons Salesforce can maintain performance consistency as the user base scales. It’s a design decision that trading off some flexibility for the guarantee of platform stability.

Case Study: Large Data Volumes and Performance Hacks

To illustrate how Salesforce balances multi-tenancy and performance, consider a scenario: Org X has 200 million records in a custom object, and users need to run reports and queries on it. This is beyond what the normal patterns smoothly handle – queries on 200M rows could strain resources. Salesforce offers a few strategies/hacks:

  • Indexes & Skinny Tables: First, make sure any filter criteria are indexed. If standard indexing (via MT_Indexes) isn’t enough or the query spans multiple fields, Salesforce might suggest a skinny table. A skinny table is a special, customer-specific table that Salesforce support can create behind the scenes. It contains a subset of fields from the main object (just the ones needed for certain heavy queries) and is stored in a traditional relational way (each field as its own column, perhaps even de-normalizing related data) (Source: developer.salesforce.com) (Source: developer.salesforce.com). For example, for an object with 100 fields, if a particular report only ever looks at 5 of those fields and only active records, a skinny table with those 5 fields and excluding soft-deleted records can be built. Because it’s a real physical table with fewer columns and rows, queries can be faster (more rows per block, and smaller indexes to scan) (Source: developer.salesforce.com) (Source: developer.salesforce.com). Salesforce’s platform will keep the skinny table in sync with the main data (using behind-the-scenes replication). Skinny tables are transparent to the user – queries automatically use them if available for that org. The trade-off is they introduce maintenance overhead (Salesforce must update them on schema changes) and they violate the pure metadata model (they are custom physical constructs). Thus, they are used sparingly, “prescription-strength” as one blog calls it (Source: developer.salesforce.com) (Source: developer.salesforce.com). They also aren’t copied to sandboxes automatically, so they’re mainly production performance workarounds (Source: developer.salesforce.com). Still, for certain large orgs, skinny tables have delivered significant report/query speedup by cutting down the I/O needed (Source: developer.salesforce.com).

  • Big Objects: If data volume needs go into billions of records (for example, storing IoT events or long-term audit logs), Salesforce introduced Big Objects. A Big Object is a different kind of object that is archived on a special storage architecture. Instead of the standard Oracle DB, Big Objects are stored in a big data store – built on a distributed NoSQL technology (HBase) behind the scenes (Salesforce hasn’t officially confirmed HBase, but it’s widely suspected). Big Objects have strict limitations: you must define an index (composed of certain fields, e.g. AccountId + Date) and you can only query using that index (no arbitrary querying or joins) (Source: www.capstorm.com) (Source: www.capstorm.com). They’re meant for “write many, read occasional bulk by key” scenarios. For instance, an org might store 5 billion event logs in a Big Object, and they can query them by a key (like get all events for a given Account in a date range). But you can’t do dynamic filtering on non-indexed fields or the queries will not run (or will be extremely slow). Big Objects allow Salesforce customers to keep massive data “on-platform” in a cheap storage, without affecting the primary DB performance, since it’s separate. As one source states, “Big Objects are Salesforce’s answer to handling massive amounts of data… unlike standard objects which have data size limits; Big Objects can handle billions of records” (Source: www.capstorm.com) (Source: www.capstorm.com). They come with trade-offs: e.g., no real-time triggers (you can’t have complex Apex on them), and a special Async SOQL is used for querying them (which runs queries in batches asynchronously). Essentially, Big Objects are an acknowledgment that not all data fits nicely in the multi-tenant Oracle model – for extremely high volumes, a more scalable (but less flexible) store is needed. This is a trend in Salesforce’s evolution: adding new storage technologies side-by-side with the core database to handle specific needs (for example, Analytics Cloud uses a columnar store separate from the main DB for crunching large datasets for BI purposes).

  • Data Archiving: Salesforce also encourages archiving data out if it’s no longer actively used. They provide a feature called Platform Big Data Store / Data Archive (formerly “Salesforce Data Archiver” or via partners) which can offload old records to external systems or Big Objects. By keeping the core tables lean (not letting, say, Cases table accumulate 100 million closed cases spanning decades), performance can be maintained. This is again an operational process: identify data that can be archived and remove it from the main tables (or mark as archived so it’s filtered out).

These measures show how Salesforce deals with extreme cases within the multi-tenant constraints. The fact that they had to introduce Skinny Tables (basically bypassing their own metadata layering for performance) is telling – it’s a pragmatic hack to deal with the reality of relational performance. But they do it in a controlled way (only Salesforce can create skinny tables, and they ensure it stays “transparent” so the user still uses the normal API).

Multi-Tenancy vs. Single-Tenancy: Pros and Cons Recap

To wrap up the isolation and resource management discussion, it’s useful to reflect on the architectural trade-offs Salesforce made. They embraced multi-tenancy fully at a time when not many enterprise software companies did. The payoffs include: economy of scale, ease of management, one version software, and consolidated performance tuning (Source: www.slideshare.net) (Source: www.slideshare.net). The challenges include: complexity in design, the need for custom frameworks (metadata, pivot tables), and having to build a lot of infrastructure to police usage.

The table below summarizes some key architectural decisions Salesforce took in its database design and the benefits/trade-offs of each:

Architectural DecisionDescriptionBenefitsTrade-offs / Challenges
Single Multi-Tenant Database Schema
(vs. separate DB per tenant)
Use one shared set of tables for all customers, distinguished by OrgID (Source: architect.salesforce.com) (Source: www.slideshare.net). All orgs use the same schema and infrastructure.– Greatly simplifies delivering one version of the software to all (centralized upgrades and fixes) (Source: www.slideshare.net).
– Maximizes resource utilization (idle resources of one org can serve others) and lowers hosting cost per tenant. (Source: www.slideshare.net)
– Allows uniform optimizations – improvements apply to all tenants at once.
– Extremely complex software layer needed to isolate data and support per-tenant customizations (required building metadata-driven system, custom query optimizer).
– Risk of “noisy neighbors” affecting others if not properly controlled (necessitating governor limits and careful capacity planning).
– Harder to accommodate wildly varying usage patterns on one DB (e.g., one org with huge data could impact overall performance if not mitigated).
Metadata-Driven Schema (No runtime DDL)
(vs. explicit per-tenant schema changes)
Represent custom objects/fields as rows in metadata tables (UDD) instead of actual DB schema changes (Source: architect.salesforce.com) (Source: itsmedinesh31.wordpress.com).– Tenants can customize freely without downtime – new fields/tables appear immediately, enabling rapid development (Source: itsmedinesh31.wordpress.com).
– Schema changes don’t fragment or mutate the physical DB, preserving stability of the core schema.
– Allows safe multi-tenant online upgrades (no migrations per org needed).
– Requires storing data in a generic format (EAV via flex columns), which is less efficient for some operations than dedicated columns.
– Puts more load on application logic (for query planning, type conversion, enforcement of constraints in app rather than DB).
– Certain RDBMS features (like native unique constraints or foreign keys) can’t be used directly and had to be reimplemented via pivot tables (Source: architect.salesforce.com) (Source: architect.salesforce.com).
Leveraging Oracle RDBMS
(vs. building a custom or using NoSQL)**
Use Oracle as underlying database engine for core transactions and storage (Source: www.techtarget.com).– Immediate availability of enterprise-grade features: transactions, strong consistency, SQL, backups, etc., reducing need to reinvent those (Source: www.packtpub.com) (Source: www.packtpub.com).
– Oracle’s scalability and partitioning features support multi-tenant needs (e.g., partition pruning by OrgID, robust indexing) (Source: architect.salesforce.com).
– Oracle’s reliability and support ecosystem (tools, experts) helped Salesforce achieve high trust from enterprise customers early on.
– High licensing and dependency on a third-party (and competitor) – cost scales with growth, and strategic reliance can be limiting (Source: www.techtarget.com) (Source: www.zdnet.com).
– RDBMS scaling is vertical to an extent; push comes to shove for extremely large workloads (hence consideration of alternative DBs or additional layers like Big Objects).
– Some mismatch with multi-tenant model required creative workarounds (Oracle isn’t multi-tenant aware out-of-the-box, so Salesforce had to enforce it logically).
“Shared-Everything” Multi-tenancy
(vs. isolated stacks per customer)
All tenants share the same servers, database processes, and application code at runtime (Source: www.slideshare.net).– Economies of scale: fewer servers overall than one-per-tenant, resulting in cost efficiency (one reason Salesforce could offer cloud CRM cheaper than on-prem).
– Unified management and monitoring – easier to manage 100 large instances than 100k small instances.
– Network effect of improvements: e.g., optimizing a query benefits all orgs that use similar queries.
– More complex engineering to ensure fairness and prevent interference (had to implement robust multi-tenancy governance, as one bad actor in a shared environment can degrade the service for others without proper controls) (Source: architect.salesforce.com) (Source: architect.salesforce.com).
– Scaling must consider aggregate usage – capacity planning is critical to add instances before existing ones become overloaded.
– Customer data co-location can raise compliance concerns (addressed via encryption and rigorous security processes). Some regulated customers might prefer isolated environment (Salesforce addressed this later via Hyperforce deployments that can isolate by region/customer if needed).
Strict Resource Governors
(vs. unlimited or trust-based usage)
Enforce limits on CPU, memory, queries, etc., per transaction and per org (Source: architect.salesforce.com) (Source: architect.salesforce.com).– Ensures no single tenant can exhaust the shared resources, preserving overall system responsiveness for all (Source: architect.salesforce.com).
– Encourages best practices in coding and data management (developers optimize to stay within limits, leading to more efficient apps) (Source: architect.salesforce.com).
– Predictable performance: platform can maintain SLAs more easily when usage is bounded.
– Puts constraints on what legitimate heavy use cases can do; certain workloads simply cannot be done directly in Salesforce (e.g., very large ETL or complex analytics might break limits) (Source: www.packtpub.com).
– Requires continuous tuning of limits as infrastructure evolves (Salesforce occasionally adjusts limits or provides exceptions for specific orgs which adds maintenance overhead).
– Can lead to frustration or complexity for developers who have to implement workarounds (like chunking operations) to fit within governor limits instead of doing a single big transaction.

(Table: Key architectural decisions in Salesforce’s database design, with their benefits and trade-offs.)

As shown, none of these decisions are free of cost. Salesforce’s success indicates that the benefits outweighed the downsides – but it’s because they invested heavily in mitigating those downsides through engineering. For instance, the lack of native uniqueness was solved by MT_Unique indexes; the risk of noisy neighbors was solved by multi-level governors and granular monitoring; the cost of Oracle is begrudgingly paid (until they possibly complete a migration to alternatives) while negotiating deals and exploring open-source side projects; the performance overhead of EAV was mitigated by caches, skinny tables, and so forth. It’s instructive for software engineers that architectural choices require complementary measures – you can’t just pick multi-tenancy and ignore the resource isolation problem, nor pick EAV schema and ignore query optimization issues.

Reliability and Case Studies

Any discussion of an in-depth architecture should include real-world outcomes: how has this design performed? What incidents has it encountered, and what adjustments or case study scenarios shed light on its behavior?

Reliability Track Record

Salesforce’s platform, with all its complexity, has maintained a strong reliability record for many years, often exceeding 99.9% uptime. The multi-tenant model inherently means any downtime can impact many customers, so Salesforce invests in rigorous operations. For example, they have global redundancy (data mirrored in multiple geographic locations), a dedicated Network Operations Center (NOC), and a transparent status dashboard (trust.salesforce.com) showing each instance’s health. Minor downtimes (for maintenance or brief network blips) are often measured in minutes per month.

However, there have been a few notable incidents that tested the architecture:

  • NA14 Outage (May 2016): We mentioned this earlier – a database failure took down the NA14 instance for over 12 hours (Source: www.infoworld.com) and even resulted in some data loss (3-4 hours of data could not be recovered) (Source: www.theregister.com). According to reports, an internal database failure and file integrity issue corrupted the storage on the primary and it cascaded to the backup (Source: www.infoworld.com). This is a scenario where multi-tenancy meant a large number of orgs (potentially thousands) were all affected simultaneously. Salesforce had to suspend some functionality (like sandbox copy, data export) for that instance even after service was restored, until they were confident in data integrity (Source: www.infoworld.com) (Source: www.theregister.com). Post-mortem likely led to improvements such as more robust failover procedures, faster failover (12 hours is an eternity in cloud service terms), and perhaps going to multi-AZ cluster rather than a single DB server + standby. It also underscored the importance of communication during incidents – Salesforce CEO was tweeting apologies, and trust site gave hourly updates (Source: www.infoworld.com). This case showed that while rare, a single DB instance issue can have broad impact; thus, it likely accelerated moves to strengthen isolation (Hyperforce aims to maybe contain blast radius by having more, smaller pods or easier failovers by containerization).

  • Search Index Incident (2014): There was an issue once where the search index service caused high load and some instances had to disable search temporarily. This wasn’t a database failure per se, but it’s an example of how an auxiliary component can impact the main service. Salesforce had to decouple and throttle such processes to protect DB performance.

  • Computing at Scale: On the positive side, Salesforce often showcases their ability to handle surges. For example, during every release upgrade, they run all customers’ test suites (~6+ million tests) on the new version in sandbox – that’s a huge computing task, which they manage by scaling out across many servers, but also by careful scheduling not to overwhelm DBs. Another example: in 2020, companies heavily reliant on Salesforce experienced spikes in usage (e.g., e-commerce or call center usage spiked due to pandemic online shift), and Salesforce instances scaled to accommodate record-high transactions. The fact that they could meet these demands without major incident speaks to the elasticity built into the multi-tenant design – the capacity headroom and the ability to add app servers or even shift load as needed.

  • Dreamforce Traffic: Salesforce’s own conference, Dreamforce, at times generates unusual usage (thousands of users doing demos on dev orgs simultaneously, etc.). Salesforce likely does special monitoring during such events to ensure no particular feature launch causes issues.

Through these, Salesforce learned and evolved. One visible evolution is Hyperforce, which one can view as a modernization and modularization of the infrastructure. With Hyperforce, Salesforce is containerizing its software and deploying on public clouds. For the database part, they could use managed database services or run Oracle on cloud VMs – it’s not fully public how the DB is handled, but given Oracle is not easily available on all clouds, they might also be exploring PostgreSQL for some products or using Amazon Aurora (Postgres-compatible) as a replacement in some regions. They’ve also acquired companies like Tableau (with their Hyper engine) and MuleSoft – not directly tied to CRM DB, but indicative of broadening their data capabilities beyond core Oracle CRM.

Expert Opinions and Perspectives

It’s informative to include what industry experts and Salesforce insiders have opined about the architecture:

  • Marc Benioff (CEO) often touted that multi-tenancy was the secret sauce of Salesforce – enabling one software to serve many. He frequently contrasted it with old on-premise software, using analogies like a multi-tenant building (apartment building) vs. single-tenant (everyone needs their own house). The result is cost savings and agility. This vision has been validated by nearly every SaaS that followed – multi-tenancy is now a standard design for cloud apps.

  • Engineers like Parker Harris (co-founder, CTO) and Doug Merrett (Chief Architect) have given talks explaining the under-the-hood design. They highlight things like: one instance can support thousands of orgs concurrently, doing tens of millions of transactions an hour, with sub-second response times in most cases, because of the careful query optimization and partitioning (Source: www.slideshare.net). They also emphasize the predictability: Salesforce does 3 major releases a year for all customers at once (Source: www.slideshare.net) – an impressive operational feat made possible by having one unified code and schema (imagine trying to upgrade thousands of separate customer environments on the same weekend – much harder).

  • Analysts like John Rymer (Forrester) have pointed out that Salesforce’s reliance on Oracle is a double-edged sword – it gave them quick scale early, but as Salesforce grew, the Oracle licensing became a huge expense and also a strategic vulnerability (since Oracle competes with them with its own cloud offerings). Rymer speculated that after the 2013 Oracle deal, Salesforce set an internal timeline to get off Oracle by the time that deal ended (Source: www.techtarget.com). Reports around 2018 did indeed say Salesforce was working on a “Sayonara” project – essentially a custom or PostgreSQL-based alternative (Source: www.techtarget.com). However, Oracle’s Larry Ellison publicly dismissed those reports, confident that Salesforce couldn’t practically move such a complex system quickly off Oracle (Source: www.techtarget.com). The truth is probably in-between: Salesforce likely has prototypes or certain services on other databases, but the main platform remains on Oracle in 2023 (given no announcements to the contrary). The inertia of a 20+ year-old core is strong.

  • Database experts have marveled (and sometimes criticized) the heavy use of EAV schema. Traditional database design would call Salesforce’s MT_Data a pathological case – extremely wide table, mostly sparse (most fields null except the ones that belong to that object type), and everything stored as text. Normally, that’s an example in textbooks of what not to do for performance. But Salesforce made it work by controlling the workload and environment meticulously. In a sense, they turned a general-purpose RDBMS into a specialized multi-tenant data management system through their software layer. It’s a testament to both the flexibility of Oracle and the cleverness of the Salesforce engineering.

  • Customers largely don’t care about these internals, except when it surfaces as constraints (like “why can’t I do a join of two objects in SOQL that aren’t directly related?” or “why did my report time out?”). Salesforce has had to educate some customers on best practices – for example, large customers are advised on things like indexing selective fields, archiving, not doing full exports frequently, etc. The presence of these guidelines shows that while the architecture scales, the use of it must be thoughtful. It’s not infinite scale: a sufficiently careless usage (e.g., trying to use Salesforce as a real-time analytics over billions of records without using the right features) will hit walls.

  • Competitive perspective: Microsoft Dynamics CRM and other competitors eventually also moved to multi-tenant cloud models, but some started with simpler approaches like one-db-per-tenant and then consolidating. Salesforce’s early lead and depth in this architecture was a differentiator for a long time. Even today, some cloud services isolate big customers on separate clusters – something Salesforce has generally avoided except in government or special cases (GovCloud has separate instances for compliance). Salesforce is now exploring more container-based isolation (with Hyperforce), which might allow mixing multi-tenancy and single-tenancy models (for example, dedicating a set of containers or even a dedicated database for a very large customer but still managing it in the unified platform framework). Essentially, a future hybrid could emerge: smaller orgs share DBs, extremely large orgs might get a standalone DB instance to themselves but still managed as part of Hyperforce deployment. This would mitigate noisy neighbor issues entirely for that org (at higher cost to that customer, presumably).

Future Directions

Looking forward, a few things stand out:

  • Hyperforce and Cloud-Native Re-architecture: Hyperforce, launched around 2020, is Salesforce’s initiative to run on public clouds like AWS, Azure, GCP, etc. It’s a significant infrastructure overhaul. It uses Kubernetes and containerization to deploy Salesforce’s services in a more automated way (Source: engineering.salesforce.com) (Source: engineering.salesforce.com). One key point: Hyperforce aims to abstract the underlying infrastructure – meaning it should be able to work with different database backends if needed, and deploy in various regions easily. Hyperforce’s design principles (Immutable infrastructure, Multi-AZ, Zero Trust, Infrastructure as Code, Clean Slate) (Source: engineering.salesforce.com) (Source: engineering.salesforce.com) show that Salesforce is modernizing how it manages instances. Instead of manually managed big iron, they treat infrastructure as code and can spin up new “orgs” on demand in new regions (for data residency requirements, etc.) much faster.

    From a database perspective, Hyperforce doesn’t necessarily mean a new database engine for the core – they might still run Oracle, but possibly on cloud VMs or using cloud DB services. However, Hyperforce’s emphasis on scale and elasticity could pave the way for more use of open-source databases for certain workloads. We may see a day where new Salesforce orgs could optionally be on a different backend (there were rumors of Salesforce exploring PostgreSQL or alternative stores for some of the load, but nothing official yet).

  • Polyglot Persistence: Salesforce has gradually become more polyglot in storage. For instance:

    • Big Objects (backed by a Bigtable-like store),
    • Salesforce Files (backed by an object storage, e.g. AWS S3, instead of Oracle blobs),
    • Search (backed by Elastic Search clusters, not Oracle text indexes),
    • Salesforce Einstein Analytics (Tableau CRM) uses its own analytic columnar DB,
    • Heroku (part of Salesforce) offers Postgres and Redis for custom apps,
    • MuleSoft connects to many external DBs etc. The CRM core will likely remain on a relational engine for the foreseeable future because refactoring that entirely would be massively risky (and almost like re-building Salesforce from scratch). But we might see certain new clouds (e.g., Marketing Cloud, or Consumer Data Platform) using different databases that integrate with Salesforce. In fact, Marketing Cloud (ExactTarget) was originally on Microsoft SQL Server (single-tenant per customer instances) and only recently being made multi-tenant. So inside Salesforce’s overall product portfolio, there are different architectures coexisting.
  • Move Off Oracle? This question lingers. Reports in 2018 by CNBC and The Information suggested Salesforce had made progress on an Oracle alternative (Source: www.theinformation.com) (Source: www.cnbc.com), but as of now, if they have, it’s under wraps. Possibly they’ve swapped out Oracle for some internal orgs or sandbox environments as tests. They did hire Bruce Langos (an Oracle veteran) and other database gurus to either help optimize Oracle or plan a migration. But given Oracle’s strong consistency capabilities and Salesforce’s reliance on them, any alternative (like a distributed NewSQL) would have to match that, which is non-trivial. It’s not just switching SQL dialect – it’s about ensuring thousands of database triggers (the ones that handle pivot table syncing, etc.) and the entire metadata layer behave exactly the same. For now, Oracle and Salesforce remain deeply entwined, with occasional rumor of that changing. If it ever does, it will likely be slowly and perhaps not a complete cut-over, but rather certain orgs or certain types of data could be stored in a different system.

  • More Vertical Partitioning of Services: The platform might break out some pieces that currently rely on the main DB. For example, there’s been talk of moving some of the activity logs or event monitoring data out of the transactional DB into a specialized store (to reduce load on main tables). The introduction of Event Bus and Async processing is a way to decouple heavy processes from the main transaction flow. That is, rather than writing a large transaction synchronously, Salesforce encourages using platform events or batch jobs which allow the system to schedule work at low-traffic times or distribute it across different workers, smoothing out spikes on the DB.

  • Edge Caching / Reading: Possibly, as Salesforce leverages public cloud, they could incorporate read replicas or caching layers where appropriate. Historically, they avoided giving stale data, so they rarely used read replicas for user queries (ensuring every read is up-to-date with the last write). But for certain read-only scenarios (like reporting), they might replicate data to a read-optimized store (say a Redshift or Snowflake) to run heavy analytics without affecting the production DB. In fact, the new Salesforce Data Cloud (aka Genie), which is meant for real-time customer data integration, uses Apache Kafka and a data lake/warehouse approach to ingest large volumes outside the core CRM DB, then surfaces insights back into Salesforce. This indicates a future where Salesforce is a hub connecting multiple specialized data stores: the core relational DB for critical records, big data stores for behavioral data, and external compute for AI/ML.

To sum up future implications: Salesforce’s internal database architecture will continue to evolve to incorporate modern cloud technologies, but the fundamental goals remain: trust (data integrity, security), scalability, and ease of use for customizers. They will likely keep the core principles – multitenancy and metadata – as those are deeply ingrained in how the platform operates. We might see the physical implementation shift (maybe Oracle to Postgres, maybe monolithic DB to a cluster of cloud database nodes), but the logical paradigm of one logical DB serving many tenants is likely to stay.

Conclusion

Salesforce’s database architecture is a pioneering example of how to achieve multi-tenancy at scale without sacrificing the qualities of traditional databases. Internally, Salesforce transformed a single Oracle database into a cloud platform serving thousands of separate applications (orgs) concurrently, through a clever combination of design patterns and technology:

  • A metadata-driven schema provides each tenant a customized data model on demand, while keeping the physical storage static and shared. This required inventing an internal data dictionary and storage strategy (pivot tables, flex columns) that could accommodate arbitrary new tables and columns as mere data entries (Source: architect.salesforce.com) (Source: architect.salesforce.com). The benefit is extraordinary agility: every org can modify its schema in minutes, and Salesforce can roll out upgrades universally, a key enabler of three major releases per year for all customers (Source: www.slideshare.net).

  • Multi-tenant isolation is enforced at every layer: logically via OrgID partitioning in queries (Source: architect.salesforce.com), physically via database partitions and separate instances (Source: architect.salesforce.com), and systematically via governance rules that throttle resource usage (Source: architect.salesforce.com) (Source: architect.salesforce.com). The result is a shared environment where customers rarely feel the multi-tenancy – except in positive ways (like automatic upgrades or performance optimizations they didn’t have to do themselves). Salesforce’s commitment to trust (security and availability) is reflected in measures like per-org encryption keys (Source: www.slideshare.net) and multi-site redundancy, which have kept data safe even as infrastructure issues have arisen.

  • The choice of a relational database (Oracle) as the core engine ensured strong consistency and rich querying capabilities from the start (Source: www.techtarget.com) (Source: www.techtarget.com). Over time, Salesforce pushed that engine to its limits – handling billions of transactions per day and petabytes of data – by using advanced features (like hash partitioning by tenant, specialized indexes) and by extending it with external systems (full-text search servers, big data storage for archiving, etc.). This demonstrates that even with the rise of NoSQL, a properly tuned RDBMS can power some of the world’s largest SaaS workloads, as long as you build the right abstraction and caching layers atop it.

  • ArchitecturalTrade-offs were skillfully balanced. The seemingly “anti-normal” data model (many fields stored in one big table as text) was necessary for multitenancy, and Salesforce mitigated its performance impact through selective indexes, query optimizers, and hardware scaling. The complexity introduced by multi-tenancy (like needing custom join logic and unique constraint handling) was offset by the huge ops simplicity for Salesforce as a provider (maintaining one global schema and code line). In effect, Salesforce decided to take on massive complexity in the platform so that things remain simple for the end-users and org-level developers. This aligns with a philosophy of “the complexity is in the cloud, not on the customer’s side”.

  • Real-world validation: The architecture has enabled Salesforce to grow from a tiny startup in 1999 to a company serving 150,000+ customers and millions of users daily (Source: backlinko.com). It has handled surges, like Black Friday e-commerce peaks or government COVID-19 tracking apps, with generally few hiccups. When issues have occurred, like the NA14 database incident in 2016, Salesforce learned and fortified the system (e.g., moving towards multi-AZ deployments in Hyperforce for better failover). The design has also allowed Salesforce to continually expand its offerings – layering on analytics, AI, and integration capabilities that work with the same underlying data because that data is centralized in the multi-tenant store, not siloed per customer.

For software engineers, Salesforce’s internal database design offers several key insights:

  • Metadata as a Platform: By treating schema definitions as data, Salesforce achieved a level of flexibility that traditional architectures cannot easily match. This illustrates the power of metadata-driven design in building multi-tenant or highly customizable software. However, it also shows the importance of robust caching and optimization when every operation becomes metaprogrammed (Salesforce had to build large-scale metadata caches to avoid performance bottlenecks (Source: architect.salesforce.com).

  • Partitioning and Sharding are Essential at Scale: Even the most powerful single-node database needs help when load and data volume grow. Salesforce’s use of partitioning (both at the application level by tenant and at the DB level by OrgID) is a textbook example of effective sharding strategy for SaaS. It allowed them to maintain most queries as small and efficient, and to operate numerous “instances” in parallel to scale out horizontally when needed. Designing your data model to include a natural partition key (like tenant) from day one greatly eases future scaling.

  • Holistic approach to performance: Salesforce didn’t rely on the database alone to solve performance; they approached it from all sides – efficient application logic (bulkification of operations), strict governance, auxiliary structures like skinny tables for edge cases, and educating users on best practices. Achieving high performance in multi-tenant systems often means building feedback loops and controls (governors) that typical single-tenant apps don’t need. It’s a proactive stance: preventing problems (through limits and design guidelines) rather than just reacting with bigger hardware.

  • Evolving architecture: The architecture one starts with will likely evolve. Salesforce in 2024 is not identical to Salesforce in 2004. They added layers for search, big data, caching, and are in the process of re-platforming on public cloud. Yet, the original core concepts have proven resilient and adaptable. This teaches us that a good architecture provides a long-term foundation but also the freedom to extend and change parts without a complete rewrite. Salesforce has been able to incorporate new technologies (like Kubernetes in Hyperforce, or Kafka for event streaming) by plugging them into the existing framework of multi-tenant data and org isolation.

In conclusion, Salesforce’s internal database workings reveal a masterclass in scaling enterprise software. The architectural decisions – to use a shared database, to abstract schema with metadata, to heavily partition data, and to enforce strict operational discipline – were bold at the time, but they enabled Salesforce to deliver a cloud service that is highly scalable, configurable, and reliable, years ahead of its competitors. These decisions involved trade-offs, but Salesforce’s ability to navigate those (through technical innovation and sometimes sheer operational effort) is what turned a CRM application into a multi-billion-dollar cloud platform used across industries.

As we move into an era of even more data and AI-driven applications, Salesforce’s architecture will continue to evolve, but the principles learned from it remain applicable: know your scalability choke points, add abstraction layers to manage complexity, partition everything you can, and never compromise on the security and integrity of customer data. By studying systems like Salesforce, engineers can gain appreciation for how careful architecture can turn even a seemingly conventional technology stack (Java + Oracle) into a cloud-scale solution powering one of the world’s largest SaaS ecosystems.

Ultimately, Salesforce’s database architecture shows that with the right design, multi-tenancy is not only possible, but can be done in a way that delivers both customization and performance at scale – a combination that has changed the expectations of enterprise software for the better.

References:

(All URLs accessed and verified for content as of current date.)

About Cirra

About Cirra AI

Cirra AI is a specialist software company dedicated to reinventing Salesforce administration and delivery through autonomous, domain-specific AI agents. From its headquarters in the heart of Silicon Valley, the team has built the Cirra Change Agent platform—an intelligent copilot that plans, executes, and documents multi-step Salesforce configuration tasks from a single plain-language prompt. The product combines a large-language-model reasoning core with deep Salesforce-metadata intelligence, giving revenue-operations and consulting teams the ability to implement high-impact changes in minutes instead of days while maintaining full governance and audit trails.

Cirra AI’s mission is to “let humans focus on design and strategy while software handles the clicks.” To achieve that, the company develops a family of agentic services that slot into every phase of the change-management lifecycle:

  • Requirements capture & solution design – a conversational assistant that translates business requirements into technically valid design blueprints.
  • Automated configuration & deployment – the Change Agent executes the blueprint across sandboxes and production, generating test data and rollback plans along the way.
  • Continuous compliance & optimisation – built-in scanners surface unused fields, mis-configured sharing models, and technical-debt hot-spots, with one-click remediation suggestions.
  • Partner enablement programme – a lightweight SDK and revenue-share model that lets Salesforce SIs embed Cirra agents inside their own delivery toolchains.

This agent-driven approach addresses three chronic pain points in the Salesforce ecosystem: (1) the high cost of manual administration, (2) the backlog created by scarce expert capacity, and (3) the operational risk of unscripted, undocumented changes. Early adopter studies show time-on-task reductions of 70-90 percent for routine configuration work and a measurable drop in post-deployment defects.


Leadership

Cirra AI was co-founded in 2024 by Jelle van Geuns, a Dutch-born engineer, serial entrepreneur, and 10-year Salesforce-ecosystem veteran. Before Cirra, Jelle bootstrapped Decisions on Demand, an AppExchange ISV whose rules-based lead-routing engine is used by multiple Fortune 500 companies. Under his stewardship the firm reached seven-figure ARR without external funding, demonstrating a knack for pairing deep technical innovation with pragmatic go-to-market execution.

Jelle began his career at ILOG (later IBM), where he managed global solution-delivery teams and honed his expertise in enterprise optimisation and AI-driven decisioning. He holds an M.Sc. in Computer Science from Delft University of Technology and has lectured widely on low-code automation, AI safety, and DevOps for SaaS platforms. A frequent podcast guest and conference speaker, he is recognised for advocating “human-in-the-loop autonomy”—the principle that AI should accelerate experts, not replace them.


Why Cirra AI matters

  • Deep vertical focus – Unlike horizontal GPT plug-ins, Cirra’s models are fine-tuned on billions of anonymised metadata relationships and declarative patterns unique to Salesforce. The result is context-aware guidance that respects org-specific constraints, naming conventions, and compliance rules out-of-the-box.
  • Enterprise-grade architecture – The platform is built on a zero-trust design, with isolated execution sandboxes, encrypted transient memory, and SOC 2-compliant audit logging—a critical requirement for regulated industries adopting generative AI.
  • Partner-centric ecosystem – Consulting firms leverage Cirra to scale senior architect expertise across junior delivery teams, unlocking new fixed-fee service lines without increasing headcount.
  • Road-map acceleration – By eliminating up to 80 percent of clickwork, customers can redirect scarce admin capacity toward strategic initiatives such as Revenue Cloud migrations, CPQ refactors, or data-model rationalisation.

Future outlook

Cirra AI continues to expand its agent portfolio with domain packs for Industries Cloud, Flow Orchestration, and MuleSoft automation, while an open API (beta) will let ISVs invoke the same reasoning engine inside custom UX extensions. Strategic partnerships with leading SIs, tooling vendors, and academic AI-safety labs position the company to become the de-facto orchestration layer for safe, large-scale change management across the Salesforce universe. By combining rigorous engineering, relentlessly customer-centric design, and a clear ethical stance on AI governance, Cirra AI is charting a pragmatic path toward an autonomous yet accountable future for enterprise SaaS operations.

DISCLAIMER

This document is provided for informational purposes only. No representations or warranties are made regarding the accuracy, completeness, or reliability of its contents. Any use of this information is at your own risk. Cirra shall not be liable for any damages arising from the use of this document. This content may include material generated with assistance from artificial intelligence tools, which may contain errors or inaccuracies. Readers should verify critical information independently. All product names, trademarks, and registered trademarks mentioned are property of their respective owners and are used for identification purposes only. Use of these names does not imply endorsement. This document does not constitute professional or legal advice. For specific guidance related to your needs, please consult qualified professionals.