Get Started with Big Objects
- Describe what big objects are.
- Identify common use cases for custom big objects.
- Identify ways to query big objects.
You, the consummate Salesforce pro, know all about standard objects, custom objects, and external objects. You know all about how these objects help you manage and manipulate data so you can do amazing trailblazing things with your org or external system.
In this bold new era of big data, you can often find yourself with a bit too much data, a victim of your own success. There are numbers to crunch, but it’s hard to effectively or efficiently crunch them. Performance takes a hit, and you start to wish that your standard, custom, or external objects could be… bigger.
That’s where big objects come in. Big objects allow you to store and manage a massive amount of data on the Salesforce platform. How massive, you ask?
A thousand records? No, think bigger.
A hundred thousand? Bigger!
A million? Not even close!
Big objects provide consistent performance for a billion records or more, and are accessible with a standard set of APIs to your org or external system. Think of all that data! We basically took a gigant-o-ray to the objects you already know and love to create big objects.
There are two flavors of big objects.
Standard big objects are defined by Salesforce and are included in Salesforce products. FieldHistoryArchive, part of our Field Audit Trail product, is an example of a standard big object. FieldHistoryArchive allows you to store up to ten years’ worth of archived field history data, helping you comply with industry regulations related to auditing and data retention.
Custom big objects are defined and deployed by you through the Metadata API. To define a custom big object, you create an object file that contains its definition, fields, and index, along with a permissionset to define the permissions for each field, and a package file to define the contents of the object metadata. The fields defined in a big object’s index determine the big object’s identity and its ability to be queried. We get into how this is all put together in the next unit.
Although you can use big objects to store different kinds of data, big objects were created to tackle a few specific scenarios.
360° View of the Customer
You’ve got a lot of customer information you want to store. From loyalty programs to transactions, order, and billing information, use a custom big object to keep track of every detail.
Auditing and Tracking
Keep a long-term view of your users’ Salesforce usage for analysis or compliance purposes.
Maintain access to historical data for analysis or compliance purposes while optimizing the performance of your core CRM or Lightning Platform applications.
Of course, keeping all that data won’t do you any good if you can’t run the proper analytics on your records. You can query big objects using standard SOQL or with Async SOQL.
You can query big objects using a subset of standard SOQL commands. Use SOQL if you know that your query will return a small amount of data, don’t want to wait for the results, or need the results returned immediately for use in Apex. We go deeper into how standard SOQL works differently with big objects in the next units.
We’ve developed Async SOQL to help manage the millions and millions of potential records in your custom big objects. Async SOQL is a way to run SOQL queries in situations where you can’t wait for the results in real time due to the sheer size of the data being queried. It is a highly scalable solution that uses a subset of SOQL commands, making it easy to use for anyone already familiar with SOQL. Async SOQL schedules and runs queries asynchronously in the background, so it can run queries that normally time out with regular SOQL. With Async SOQL, you can run multiple queries in the background while monitoring their completion status. Set up your queries and come back a few hours later to an awesome dataset to work with. Async SOQL is the most efficient way to process the large amount of data in a big object.
Because of the scale that big objects operate in, they don’t work exactly like non-big objects. Here are some things to keep in mind when using big objects.
- Big objects support only object and field permissions.
- You must use the Metadata API to define or add a field to a custom big object. You can’t do it through the UI.
- SOQL relationship queries are based on a lookup field from a big object to a standard or custom object in the select field list (not in filters or subqueries).
- Big objects support custom Salesforce 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.
- Big objects don’t support transactions that include big objects, standard objects, and custom objects.
- To support the scale of data in a big object, you can’t use triggers, flows, processes, and the Salesforce app.