Newer Version Available
Big Objects Best Practices
A big object is unique because of its ability to scale for massive amounts of
data.
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and
Developer Editions for up to 1 million records Additional record capacity and Async SOQL query is available as an add-on license. |
Considerations When Using Big Objects
- To define a big object or add a field to a custom big object, use either Metadata API or Setup.
- Big objects support custom Lightning and Visualforce components rather than standard UI elements home pages, detail pages, list views, and so on.
- You can create up to 100 big objects per org. The limits for big object fields are similar to the limits on custom objects and depend on your org’s license type.
- You can’t use Salesforce Connect external objects to access big objects in another org.
- Big objects don't support encryption. If you archive encrypted data from a standard or custom object, it is stored as clear text on the big object.
Design with Resiliency in Mind
The big objects database stores billions of records and is a distributed system that favors consistency over availability. The database is designed to ensure row-level consistency.
When working with big data and writing batches of records using APIs or Apex, you can experience a partial batch failure while some records are written and others aren’t. Because the database is highly responsive and consistent at scale, this type of behavior is expected. In these cases, simply retry until all records are written.
Keep these principles in mind when working with big objects.
- The best practice when writing to a big object is to have a retry mechanism in place. Retry the batch until you get a successful result from the API or Apex method.
- Don’t try to figure out which records succeeded and which failed. Retry the entire batch.
- Big objects don’t support transactions. If attempting to read or write to a big object using a trigger, process, or flow on a sObject, use asynchronous Apex. Asynchronous Apex has features like the Queueable interface that isolates DML operations on different sObject types to prevent the mixed DML error.
- Because your client code must retry, use asynchronous Apex to write to a big object. By writing asynchronously, you are better equipped to handle database lifecycle events.