Developer Fundamentals · Topic 1 of 4
Multi-Tenancy, MVC and the Lightning Component Framework
Salesforce multi-tenant architecture for developers: shared resources, governor limits, metadata-driven design, MVC and the Lightning Component Framework.
- 4 min
- Multi-tenancy means shared infrastructure, so governor limits apply to every transaction.
- Customizations are metadata; each Apex class has its own API version.
- MVC: objects are the model, pages and components are the view, Apex and JavaScript controllers are the controller.
What it is
Salesforce is a multi-tenant platform. Many customer orgs share the same servers, database and application code, and each org's data is kept separate by its org ID. Your customizations are stored as metadata, so the platform can upgrade everyone three times a year without breaking your apps.
Because resources are shared, the platform enforces governor limits: hard caps on queries, DML, CPU time and memory per transaction. No single org can slow down its neighbours.
Design frameworks organise code on top of this platform. The classic one is MVC (Model, View, Controller). The modern UI framework is the Lightning Component Framework, which includes Aura components and Lightning Web Components.
How it works
What multi-tenancy means for a developer
| Platform fact | What it means for your code |
|---|---|
| Shared database and servers | Governor limits stop runaway code; a limit error cannot be caught |
| Metadata-driven | Objects, fields, code and pages are metadata you can retrieve and deploy |
| Automatic upgrades | Apex classes keep their own API version, so old code keeps its old behaviour |
| Org isolation | Data is never visible across orgs; every query runs inside your org |
| Trust and security | Security settings such as sharing and field-level security apply to the platform for everyone |
Apex is compiled and run on Salesforce servers. You cannot install server software, change the database schema directly or run long processes. You work with the platform's objects, its language and its limits.
MVC on Salesforce
| MVC layer | Salesforce pieces |
|---|---|
| Model | Standard and custom objects, fields and relationships; the schema |
| View | Lightning pages, Lightning Web Components, Aura components, Visualforce pages, page layouts |
| Controller | Standard controllers, Apex custom controllers and extensions, JavaScript controllers in components |
In Visualforce the split is very clear: the page markup is the view, standardController="Account" or an Apex class is the controller, and the Account object is the model.
In Lightning Web Components the view is the HTML template, the JavaScript class holds the component's controller logic, and an Apex class marked @AuraEnabled provides server-side data when Lightning Data Service is not enough.
The Lightning Component Framework
The Lightning Component Framework is a client-side UI framework for single-page apps on Salesforce.
| Feature | Detail |
|---|---|
| Two programming models | Aura components (the original model) and Lightning Web Components (built on web standards) |
| Event-driven | Components talk through events instead of direct calls |
| Runs in the browser | Rendering happens on the client, and the server supplies data |
| Lightning Data Service | Loads and saves records with caching and sharing applied, without Apex |
| Security | Lightning Web Security or Lightning Locker isolates each component's namespace |
| Reuse | Components can be placed in Lightning App Builder, Experience Builder, flows and utility bars |
Lightning Web Components and Aura components can live on the same page. An Aura component can contain a Lightning Web Component, but a Lightning Web Component cannot contain an Aura component.
A worked example
A team builds a page that shows an account's open cases and lets agents close them.
- Model: the Account and Case objects and the Status field.
- View: a Lightning Web Component on the account record page.
- Controller: the component's JavaScript handles the button click, and an Apex method closes the cases in one DML statement.
The Apex method updates a list of cases with one update call rather than one call per case. On a multi-tenant platform, bulk-safe code is not optional: the same method may be called for one case or for two hundred.
When a question asks why Salesforce enforces governor limits, the answer is multi-tenancy: shared resources must be protected for every tenant.
How the exam asks about this
- "Which part of MVC is the custom object?" The model.
- "Why does the platform throw an uncatchable exception at the 101st query?" Governor limits protect the shared multi-tenant platform.
- "Which component model is built on web standards?" Lightning Web Components.
What to remember for the exam
- Multi-tenancy means shared infrastructure, so governor limits apply to every transaction.
- Customizations are metadata; each Apex class has its own API version.
- MVC: objects are the model, pages and components are the view, Apex and JavaScript controllers are the controller.
- The Lightning Component Framework covers Aura components and Lightning Web Components.
- Aura can contain LWC; LWC cannot contain Aura.
A governor limit exception, System.LimitException, cannot be caught with try and catch. Design the code to stay under the limit instead.
Common mistakes
Treating governor limits as configurable. They are fixed per transaction; you cannot raise them in Setup.
Calling a page layout the controller. Layouts are part of the view.
Assuming LWC can wrap an Aura component. Only the reverse works.
Check yourself
Why does Salesforce enforce governor limits?
Because the platform is multi-tenant, and shared resources must be protected so one org cannot affect others.
In a Visualforce page with a custom Apex controller, which part is the model?
The sObjects, such as standard and custom objects, that the controller reads and writes.
Can a Lightning Web Component contain an Aura component?
No. An Aura component can contain a Lightning Web Component, but not the other way round.
Topic 1 of 4 in Developer Fundamentals
Test yourself on Developer Fundamentals
The full Salesforce Platform Developer question bank has 645 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Salesforce. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.