Performance & Scalability Flashcards
Q. What is performance optimization in Salesforce?
A. Performance optimization in Salesforce ensures that applications run efficiently and quickly by minimizing latency, CPU time, and governor limit consumption.
Q. What is scalability in Salesforce?
A. Scalability refers to the ability of Salesforce to handle increasing volumes of data, users, and transactions without performance degradation.
Q. What are the key factors affecting Salesforce performance?
- SOQL query efficiency
- Data storage & indexing
- API call optimization
- Governor limits & execution context
- User interface performance
Q. What are governor limits in Salesforce?
A. Governor limits are restrictions imposed by Salesforce to ensure fair resource usage in a multi-tenant environment.
Q. What are key Apex governor limits?
- SOQL queries per transaction: 100
- DML statements per transaction: 150
- CPU time per transaction: 10,000ms
- Heap size limit: 6MB (synchronous), 12MB (asynchronous)
Q. How can you optimize Apex code to avoid governor limits?
- Use bulkified SOQL & DML operations
- Use collections (Lists, Sets, Maps)
- Implement asynchronous processing (Batch Apex, Queueable Apex)
Q. What is Large Data Volume (LDV) in Salesforce?
A. LDV refers to datasets exceeding 1 million records, requiring performance optimization techniques.
Q. What are best practices for handling LDV?
- Use indexed fields in SOQL queries
- Implement Skinny Tables
- Use archiving strategies
- Enable Async SOQL & Batch Apex
Q. What is a Skinny Table in Salesforce?
A. A special database table that contains frequently accessed fields to improve query performance.
Q. What is an Indexed Field in Salesforce?
A. A field that has an index stored in the database, allowing faster searches and SOQL execution.
Q. What is a selective SOQL query?
A. A query that uses indexed fields, returning less than 10% of total object records for efficiency.
Q. What are best practices for writing optimized SOQL queries?
- Use SELECT specific fields instead of SELECT *
- Filter queries with indexed fields
- Avoid nested queries inside loops
- Use LIMIT & ORDER BY for performance
Q. How can you check if a SOQL query is selective?
A. Use the Query Plan Tool in Developer Console.
Q. What are common indexed fields in Salesforce?
- Record ID
- External ID
- Name
- CreatedDate
Q. What are best practices for managing large datasets in Salesforce?
- Implement Data Archiving Strategies
- Use Big Objects for historical data
- Offload data to external databases (AWS, Azure, GCP)