A big object stores and manages massive amounts of data on the Salesforce platform. We can archive data from other objects or bring massive datasets from outside systems into a big object to get a full view of our customers. Big objects provide consistent performance for a billion records or more and are accessible with a standard set of APIs. Big object is designed on the Big Data concept to store massive or complex data.
Why do we need Big Objects?
Storing huge data in Salesforce is costly and if we put complete data in Salesforce then it will impact customer-centric application performance. Big object is part of the Salesforce platform but it has separate storage. It is not counted on the active storage of our Salesforce Org. Big Data Storage is cheaper than normal Salesforce storage so we can use this for better performance.
Where Big Objects are used internally?
Salesforce has used Big objects in many important products/features. Some of them are
- Field Audit Trail in Platform Shield
- Storing Login Event
- Storing URI Event
Types of Big Objects
There is two flavors of Big Objects.
Standard big objects:
Salesforce defines a Standard big object to store field history which is part of the Field Audit Trail product. These data can be stored for up to 10 years and follow all industry regulations for data auditing and data retention.
Custom big objects:
Custom big objects are created similar to other custom objects. We can create fields based on our requirements and we can also use the index on them.
How to query Big Object?
We can use SOQL if small data will be returned. If we have huge data which will take time to return then we can use Async SOQL. Async SOQL schedules and runs queries asynchronously in the background, so it can run queries that normally time out with regular SOQL. Async SOQL is the most efficient way to process a large amount of data in a big object.
Benefits of Big Objects:
- It is a native Salesforce data lake that is stored in the secure Salesforce data center
- It provides consistent scale and performance
- It can be setup declarative or using metadata API
- Async SOQL allows complex operations on data storage
- Powers many internal products like Shield, Pardot, Chatbot
- 10x cost-effective than normal Salesforce Storage
Challenge in Big Objects:
- Global Search not supporting Big Objects
- Big objects do not have a regular Id. They have primary key fields to query data.
- We can’t edit or delete the index after it is created. To change the index, start over with a new big object.
- Big objects don’t support transactions that include big objects, standard objects, and custom objects.
- We can create up to 100 big objects per org. It depends on our organization’s license type.
- Big objects do not support sharing. If we need then we can use the parent lookup field for this.