Salesforce Basics: OWD, Governor Limits and the Developer Role

Governor limits in Salesforce are hard, per-transaction execution caps that the platform enforces to stop any single org from overloading shared server infrastructure. They restrict SOQL queries to 100 per synchronous transaction, DML statements to 150, heap size to 6 MB and CPU time to 10,000 ms. Exceed any limit and Salesforce throws a fatal LimitException.

  • OWD (org-wide defaults) set the baseline access level for every record in an object: private, public read-only or public read/write.
  • Governor limits in Salesforce are non-negotiable runtime caps; hitting one throws a fatal LimitException and rolls back the transaction.
  • Salesforce developers spend most of their day writing bulkified Apex, SOQL, and Lightning components, not just clicking through Setup.
  • DISTINCT is not a native SOQL keyword — you work around it using GROUP BY or Set collections in Apex.
  • Test methods block HTTP callouts by design; you must use mock frameworks to simulate external responses in test context.

OWD in Salesforce and the Sharing Model

OWD in Salesforce stands for org-wide defaults. It is the starting point of the entire data-sharing architecture. Every object in your org gets a default access level, and every user who is not the record owner starts from that baseline.

The three most common OWD settings are Private (only the owner and users above them in the role hierarchy can see the record), Public Read Only (everyone can read, only the owner can edit) and Public Read/Write (everyone can read and edit). There is also a Controlled by Parent option for detail objects in master-detail relationships.

How Sharing Rules Open Access Back Up

You always set OWD to the most restrictive level you need, then use sharing rules, manual sharing, and role hierarchies to open access back up for specific groups. Sharing rules can be criteria-based (records matching certain field values) or ownership-based (records owned by a particular role or group).

This layered approach matters enormously in Indian enterprise deployments. A large BFSI company running Salesforce Financial Services Cloud might keep customer account records Private at OWD level, then use territory-based sharing rules to give regional sales managers in Bengaluru, Mumbai or Chennai visibility over their portfolio without exposing records from other regions. Salesforce hiring in India is concentrated in Bengaluru, Hyderabad, Pune, Mumbai and Chennai, according to LinkedIn Talent Insights 2024, making platform knowledge of this kind directly relevant to the local job market.

Role Hierarchy and Manual Sharing

The role hierarchy grants upward visibility by default: a manager always sees records owned by people below them. Manual sharing lets record owners grant one-off access to individuals, though admins can disable it per object. Apex managed sharing gives developers programmatic control when declarative options are not enough.

Governor Limits in Salesforce: What They Are and Why They Bite

Governor limits in Salesforce exist because the platform is multi-tenant. Every customer’s code runs on the same infrastructure, so Salesforce enforces strict per-transaction limits to keep one badly written trigger from degrading performance for everyone else. That is not a limitation; it is the design.

The limits that trip up developers most often are the SOQL query limit (100 queries per synchronous transaction), the DML statement limit (150 per transaction), the heap size limit (6 MB synchronous / 12 MB asynchronous) and CPU time (10,000 ms synchronous). According to Salesforce’s official Apex Developer Guide, these governor limits in Salesforce apply per transaction, not per user or per hour, and violations throw an immediate fatal exception with no partial rollback.

According to IDC’s Salesforce Economy report, Salesforce and its ecosystem are projected to create 9.3 million jobs globally between 2022 and 2026, with India identified as one of the fastest-growing markets for certified Salesforce professionals. A separate NASSCOM 2024 survey found that Salesforce skills ranked in the top five most-requested cloud platform competencies among Indian IT services employers, with average salaries for certified Salesforce developers ranging from 6 LPA at entry level to 22 LPA at senior level on Naukri.com listings.

The Most Common Governor Limit Violations in Salesforce

The classic mistake is writing SOQL inside a loop. If a trigger fires on 200 records and your code runs a query for each one, you hit the 100-query governor limit in Salesforce on the 101st record and the whole transaction fails. The fix is to collect IDs first, query once outside the loop, and map results in memory.

DML inside loops is just as dangerous. Batch all your inserts, updates and deletes into lists, then call a single Database.insert() or update() after the loop. This is what bulkification actually means in practice: treating every operation as if it might process 200 records simultaneously.

Governor Limits in Salesforce: Synchronous vs Asynchronous Reference Table

Limit Type Synchronous Asynchronous (Batch/Future)
SOQL Queries 100 200
DML Statements 150 150
Heap Size 6 MB 12 MB
CPU Time 10,000 ms 60,000 ms
SOQL Rows Retrieved 50,000 50,000
Future Method Calls 50 per transaction N/A

Source: Salesforce Apex Developer Guide, Apex Governor Limits (Spring 2025 release).

Asynchronous contexts (Batch Apex, @future, Queueable Apex) get more headroom, which is why heavy data processing jobs should always run async. The trade-off is that async jobs are queued, not instant, so they are not suitable for real-time UI interactions.

What Does a Salesforce Developer Do Day to Day?

A Salesforce developer’s actual job is a mix of declarative configuration and programmatic development. You are not just writing code; you are translating business requirements into working functionality on the platform, often choosing between a Flow, a Process Builder (now largely deprecated), or custom Apex based on complexity.

Day to day, expect to write Apex triggers and classes, build Lightning Web Components (LWC) using HTML, JavaScript and Salesforce’s component framework, write SOQL to pull data, and create test classes that hit at least 75% code coverage (the minimum Salesforce requires for deployment to production).

Lightning Formatted Text and the Component Ecosystem

Lightning formatted text is a base Lightning component that renders a text string and automatically converts URLs and email addresses into clickable links. It is a good example of how Salesforce developers use pre-built base components rather than writing raw HTML, keeping UI consistent and accessibility-compliant without extra effort.

LWC development also involves working with the @wire decorator to pull Salesforce data reactively, using @track and @api for state management, and deploying through Salesforce CLI or a CI/CD pipeline. If you are eyeing entry-level Salesforce developer roles, getting comfortable with LWC is non-negotiable.

Certifications That Actually Matter

The Salesforce Certified Platform Developer I (PDI) is the standard starting point. It tests your knowledge of Apex, SOQL, governor limits in Salesforce and the data model. Platform Developer II goes deeper into design patterns and integration. Indian IT services firms including TCS, Infosys, Wipro and Capgemini list PDI as a baseline requirement for Salesforce developer roles.

If you are planning your career path and wondering which technical skills to stack alongside Salesforce, check out this breakdown of top skills every college student should build before graduation: the overlap with cloud and API literacy is significant.

DISTINCT in SOQL: What You Need to Know

SOQL does not support a DISTINCT keyword the way SQL does. To get unique values, use GROUP BY on the field you want deduplicated, or query all records and deduplicate in Apex using a Set. For example, to get unique account industries: SELECT Industry FROM Account GROUP BY Industry. This is one of the most common gotchas for developers coming from a traditional SQL background.

The GROUP BY approach works well when you need the distinct values themselves. If you need full records but want to avoid processing duplicates, collect primary keys into a Set<Id> in Apex and filter from there. The right approach depends on what you are doing with the data downstream.

Test Methods, Callouts and Common Apex Pitfalls

Test methods in Apex run in an isolated context that does not allow actual HTTP callouts to external services. The error message “methods defined as testmethod do not support web service callouts” is Salesforce enforcing this boundary deliberately. If your test calls a method that makes an HTTP request, the transaction will fail unless you have set up a mock.

The solution is to implement the HttpCalloutMock interface and register your mock with Test.setMock() before calling the code under test. This lets you simulate API responses without hitting a live endpoint, which keeps tests fast, deterministic and free from external dependencies. It is also a requirement for any code that integrates with third-party APIs such as payment gateways, SMS providers, or government data services like India’s GST APIs.

Other Test Context Restrictions Worth Knowing

Test methods also cannot send emails (use SingleEmailMessage with Test.isRunningTest() guards), cannot see data outside their own transaction unless you use @isTest(seeAllData=true) (which you should avoid), and run with governor limits in Salesforce that are separate from production limits. Hitting a limit in a test class is still a real limit violation: the test fails just like production code would.

Writing good test classes is genuinely one of the skills that separates junior Salesforce developers from mid-level ones. If you want to see how Salesforce fits into broader high-paying tech career options, this guide to online courses for high-salary jobs puts it in context alongside cloud, AI and cybersecurity roles.

For students still mapping out their options, this resource on best career options in 2026 for students and professionals covers where Salesforce sits in the broader tech hiring picture. If you are building your skills on a budget, the best free learning platforms for students list includes resources where you can start Salesforce Trailhead for free.

Career switchers and fresh graduates should also read through this honest guide on choosing the right career path after graduation before committing to a Salesforce specialisation: fit matters as much as demand.

The practical next steps this week: set up a free Salesforce Developer Edition org at developer.salesforce.com, complete the Apex Basics and Database Trailhead module, write your first bulkified trigger, and check out the certification courses at 3.0 University to see where structured learning fits into your plan.

Frequently Asked Questions

What are governor limits in Salesforce?

Governor limits in Salesforce are hard per-transaction execution caps enforced by the platform to prevent any single org from consuming excessive shared server resources. They restrict SOQL queries to 100 per synchronous transaction, DML statements to 150, heap size to 6 MB and CPU time to 10,000 ms. Exceeding any governor limit throws a fatal LimitException and rolls back the entire transaction.

What is the SOQL query limit in Salesforce?

The SOQL query governor limit in Salesforce is 100 queries per synchronous transaction and 200 queries per asynchronous transaction. Placing SOQL queries inside loops is the most common way developers accidentally hit this limit. The fix is to query outside the loop, collect results in a map, and reference the map inside the loop.

What is OWD in Salesforce?

OWD stands for org-wide defaults. It is the baseline record access level Salesforce applies to every object for users who are not the record owner. Common settings are Private, Public Read Only and Public Read/Write. You always set OWD to the most restrictive level needed, then use sharing rules and role hierarchies to open access up for specific users or groups.

What is the difference between synchronous and asynchronous governor limits in Salesforce?

Synchronous governor limits in Salesforce are tighter: 100 SOQL queries, 6 MB heap, 10,000 ms CPU time. Asynchronous contexts such as Batch Apex and Queueable Apex get more headroom: 200 SOQL queries, 12 MB heap and 60,000 ms CPU time. Heavy data processing should always run asynchronously to avoid hitting synchronous caps.

Why do Salesforce governor limits exist?

Salesforce is a multi-tenant platform, meaning thousands of organisations share the same server infrastructure. Governor limits in Salesforce prevent any single org’s code from consuming excessive resources and degrading performance for others. They are enforced per transaction, not per day or per user, and hitting one throws a fatal exception that rolls back the entire transaction immediately.

What does a Salesforce developer do day to day?

A Salesforce developer writes Apex classes and triggers, builds Lightning Web Components, creates SOQL queries, configures automation with Flows, and writes unit test classes. They translate business requirements into platform functionality, handle integrations with external APIs, and maintain code quality through peer review and deployment pipelines. Certification in Platform Developer I is the standard entry benchmark in the Indian job market.

How do you use DISTINCT in SOQL?

SOQL does not have a native DISTINCT keyword. To retrieve unique field values, use GROUP BY on the target field, for example SELECT Industry FROM Account GROUP BY Industry. Alternatively, query records in Apex and deduplicate using a Set collection. Developers coming from a SQL background often search for DISTINCT and need to learn this GROUP BY workaround early.

Why do test methods not support web service callouts?

Salesforce isolates test execution from live external services to keep tests fast, reliable and free of network dependencies. The “methods defined as testmethod do not support web service callouts” error appears when test code tries to make a real HTTP request. The fix is to implement the HttpCalloutMock interface and register it with Test.setMock() before invoking the code being tested.

If you are serious about building a career in cloud platforms, Salesforce is a strong starting point. 3.0 University offers structured online certification courses in Cybersecurity, Ethical Hacking, AI, Blockchain and Web3, all designed for students, working professionals and career switchers in India who want practical, industry-ready credentials. Browse the full course catalogue at 3.0 University and find the programme that fits where you want to go.

Last updated: September 2026. Reviewed by the 3University editorial team.

We create, review, and maintain educational content covering Cybersecurity, Ethical Hacking, Artificial Intelligence, Blockchain, Web3, and emerging technologies.

Read More Articles