Big Object

Big Object in Salesforce

Salesforce has a limitation on performing queries on large number of records. Especially when your data is massive (assume more than 10k records per object) performing queries and performance of the system downgrades. That is where Big Object Comes in to picture. Leveraging Big Objects we can perform asynchronous queries to retrieve huge sets of data, without affecting the performance in a faster way. Big Objects can help you improve performance and scale your Implementation when your Data is huge in Salesforce!

What is Big Object

Object that stores and manages massive data values within Salesforce Without affecting performance. Big objects provide consistent performance for a billion records, and are accessible with a standard set of API’s to your org or external system.

Custom big objects can be created by the Metadata API. To define a custom big object, you need to create an object file that contains its definition, field’s, and index, with a Permission-set to define the permissions for each field, and  package file to define the contents of the object metadata.

Big Object Use Cases

  • Capture User Activity Code reviews, time entries, page views, field audits etc.
  • Retain Historical Data Historical data stored for compliance
  • 360 Customer View Ancillary customer data e.g. Purchase Details, Transactions

Deploying your Schema

Big Object Data Manipulation

  • Apex CRUD
    • ▶Create / Update (Idempotent Behavior)
    • ▶ insertImmediate(sobject) OR insertImmediate(sobjects)
  • ▶Read
    • ▶ SOQL Queries
    • ▶ Async SOQL
  • CSV Files
    • API (Bulk API, SOAP API)

Using Standard SOQL with Big Objects

  • Executes synchronously
  • All Indexes are mandatory
  • Comparison Operators (=, <, >, <=, >=, IN)
  • Not Supported Operators
  • (!=, LIKE, NOT IN, EXCLUDES, INCLUDES)

SOQL Vs Async SOQL Usage Considerations

FeatureStandard SOQLAsync SOQL
Mode of ExecutionSynchronousAsynchronous
Immediate Response Required?YesNo
Expected Result Set SizeSmaller Data Sets (Thousands of records)Large Data Sets (Millions of records)
Best Suited For•Displaying Data on UI•Manipulations within Apex•Aggregation•Summarizing for Analytics
Filter using Non Index fieldsYesNo
Sample FormatSELECT Game_Platform__c, Play_Date__cFROM Customer_Interaction__bWHEREGame_Platform__c=’PC’ AND Play_Date__c=’2017-09-06′{“query”: “SELECT Account_c, In_Game_Purchase__c FROM Customer_Interaction__b WHERE Play_Date__c=’2017-09-06′”,“operation”: “insert”,“targetObject”: “Customer_Interaction_Analysis__c”,“targetFieldMap”: {“Account__c”:”Account__c”,“In_Game_Purchase__c”:”Purchase__c”},“targetValueMap”:{“$JOB_ID“ : “BackgroundOperationLookup__c”,“Copy fields from source to target“ : “BackgroundOperationDescription__c”}}

Difference Between Custom Object and Big Object


Custom ObjectBig Object
CreateManual and MetadataMetadata
API Name__c__b
Track ActivityYesNo Option
Field History TrackingYesNo Option
Data TypeAllText, Date Time, Lookup, Number, Long Text Area
Edit FieldYesYes
Delete FieldYesNo
TriggerYesNo
ReportYesNo
StorageIt Count Against StorageIt doesn’t count against Storage

Recording of session

Here is PPT of session

Considerations for Big Objects Usage

  • General
    • Metadata API
    • Max. 100 Big Objects per org
    • Supports DateTime, Lookup, Number, Text, Long Text Area field types only
    • Triggers, Flows, Processes, Salesforce App are unavailable
    • Async SOQL is restricted to specific licenses
  • UI / UX
    • Standard UI unavailable (Tabs, Detail Pages, List Views)
    • Works with Visualforce Pages or Lightning Components
  • Data Security & Access
    • Supports Object & Field Permissions only
  • Analytics
    • No support for Report Builder
    • Einstein Analytics supported
  • Packaging
    • Included in Managed Packages

1,021 total views, 6 views today

Leave a Comment