5 - Bulkification in Salesforce (Most Important)
Background Understanding ---> No, DML (Data Manipulation Language) and SOQL (Salesforce Object Query Language) are different in Salesforce:
DML (Data Manipulation Language): Used for modifying data in the database. DML operations include
insert,update,delete,upsert,merge, andundelete. DML commands alter the state of the database by creating, updating, or removing records.SOQL (Salesforce Object Query Language): Used specifically for querying data from the database. SOQL retrieves data but does not modify it. Common SOQL commands include
SELECT, which fetches records based on specific criteria.
What are Governer Limits
Governor limits in Salesforce are enforced restrictions that help maintain system stability by preventing any single code execution from monopolizing shared resources. Since Salesforce operates on a multi-tenant architecture, these limits are crucial to ensuring fair resource allocation across all organizations using the platform.
Key types of governor limits include:
SOQL Query Limits: Restrict the number of SOQL queries you can execute in a single transaction (e.g., 100 SOQL queries in synchronous Apex).
DML Limits: Restrict the number of DML statements (like
insert,update,delete) you can perform (e.g., 150 DML statements in a transaction).Heap Size Limit: Limits the total memory your code can use in a transaction (e.g., 6 MB for synchronous and 12 MB for asynchronous).
CPU Time Limit: Caps the amount of time (in milliseconds) that a transaction can consume on the Salesforce servers (e.g., 10 seconds for synchronous and 60 seconds for asynchronous).
Batch Sizes and Collection Limits: Restrict the size of lists or the number of records a batch process can handle.
API Call Limits: Restrict the number of API calls an organization can make to Salesforce within a 24-hour period.
Bulkification
Bulkification in Salesforce optimizes code to handle large data volumes efficiently within governor limits. Key principles include:
Bulk Triggers: Process multiple records at once in triggers by using collections and batch updates.
Comments
Post a Comment