SaasGuru Logo

Kickstart your career with the World's First Salesforce & AI Programs by an IIT - Explore Courses 🎉

Kickstart your career with the World's First Salesforce & AI Programs by an IIT - Explore Courses 🎉
Big Objects in Salesforce The Ultimate Guide 2024

Big Objects in Salesforce: The Ultimate Guide 2024

In today’s data-driven world, businesses constantly struggle to manage and analyze vast amounts of information. Salesforce, a leading customer relationship management (CRM) platform, has risen to this challenge with the introduction of Big Objects. This powerful feature allows organizations to store and manage massive datasets directly within the Salesforce platform. 

By 2025, it’s estimated that 463 exabytes of data will be created each day globally. These numbers underscore the growing importance of efficient large-scale data storage solutions like Salesforce Big Objects.

What is a Big Object in Salesforce?

Big Objects are custom Salesforce objects designed to store and manage massive amounts of data, up to billions of records. They provide a scalable solution for retaining and accessing historical data, tracking high-volume data changes, and integrating external big data systems with Salesforce.

Key features of Big Objects include:

  1. Massive data storage capacity
  2. High-performance queries on large datasets
  3. Seamless integration with Salesforce platform features
  4. Support for field history tracking and archiving

How to Use Big Objects in Salesforce

Big Objects in Salesforce are designed to handle and store large datasets, enabling businesses to manage historical data and track changes efficiently. Here’s how you can use Big Objects:

  1. Store Historical Data: Big Objects are ideal for storing non-transactional, historical data, such as customer interactions, system logs, or transactional archives.
  2. Track Data Changes: Use Big Objects to track data changes over time for analysis or auditing purposes.
  3. Custom Integrations: Integrate Big Objects with external data systems to manage large-scale data operations across different platforms.
  4. Optimize Performance: When working with large datasets, utilize indexed fields to optimize query performance, speeding up data retrieval.
  5. Report Generation: While Big Objects aren’t directly reportable, you can use custom solutions like Apex classes to extract data from Big Objects and create custom reports.

How to Create Big Objects in Salesforce

Creating a Big Object in Salesforce involves several key steps:

1. Navigate to Big Objects in Setup:

    • From Setup, enter “Big Objects” in the Quick Find box.
    • Click on “Big Objects” under the Create section.

2. Create a New Big Object:

    • Click “New” to create a new Big Object.
    • Define the object’s Label, Plural Label, and Object Name.
    • Choose the Fields for your Big Object (minimum one field must be marked as the primary key).

3. Index Fields:

    • Define the fields that will be indexed. Indexed fields are essential for optimizing queries on large datasets.

4. Save and Deploy:

    • After defining your fields and indexes, click “Save.”
    • Deploy the Big Object by clicking on the “Deploy” button.

5. Populate Data:

    • Populate your Big Object using Apex, Bulk API 2.0, or REST API.

Big Objects Best Practices

To maximize the benefits of Big Objects, consider these best practices:

  1. Use Big Objects for appropriate use cases, such as storing historical data or high-volume transactional data.
  2. Design your Big Object schema carefully, as it cannot be modified after deployment.
  3. Implement efficient indexing strategies to optimize query performance.
  4. Leverage async operations for data insertion and deletion to manage large volumes effectively.
  5. Use custom metadata types to manage Big Object configurations.

saasguru salesforce labs

Define and Deploy Custom Big Objects

To create a custom Big Object:

  1. From Setup, enter “Big Objects” in the Quick Find box and select Big Objects.
  2. Click “New” to start the creation process.
  3. Define the object’s fields, including at least one field as the primary key.
  4. Create an index to optimize query performance.
  5. Save and deploy the Big Object.

Populate a Custom Big Object

There are several ways to populate a Big Object:

  1. Apex: Use the Database.insertImmediate() method for synchronous insertions or Database.insertAsync() for asynchronous operations.
  2. REST API: Utilize the Composite resource for bulk insertions.
  3. Bulk API 2.0: Ideal for loading large volumes of data.

Example Apex code for asynchronous insertion:

List<MyBigObject__b> records = new List<MyBigObject__b>();

// Populate the list with records

Database.insertAsync(records, new AsyncCallback());

public class AsyncCallback implements Database.AsyncCallback {

    public void callback(Database.BatchResult[] results) {

        // Handle the results

    }

Delete Data in a Custom Big Object

Deleting data from a Big Object requires using the Database.deleteAsync() method or the Bulk API 2.0. Here’s an Apex example:

List<MyBigObject__b> recordsToDelete = [SELECT Id FROM MyBigObject__b WHERE CreatedDate < :oldestDate LIMIT 10000];

Database.deleteAsync(recordsToDelete, new AsyncCallback());

Also Read – Introduction to Salesforce sObjects

Big Objects Queueable Example

Using a Queueable Apex class allows for better control over asynchronous operations:

public class BigObjectQueueable implements Queueable {

    public void execute(QueueableContext context) {

        List<MyBigObject__b> records = new List<MyBigObject__b>();

        // Populate the list with records

        

        Database.insertAsync(records, new AsyncCallback());

    }

}

// Enqueue the job 

System.enqueueJob(new BigObjectQueueable());

Big Object Query Examples

Querying Big Objects requires using SOQL with some limitations. Here are a few examples:

// Basic query

SELECT Field1__c, Field2__c FROM MyBigObject__b WHERE IndexedField__c = ‘Value’

// Query with ORDER BY (must use indexed field)

SELECT Field1__c FROM MyBigObject__b WHERE IndexedField__c > ‘Value’ 

ORDER BY IndexedField__c DESC LIMIT 100

// Query with date range

SELECT COUNT() FROM MyBigObject__b WHERE CreatedDate >= 2023-01-01T00:00:00Z AND CreatedDate < 2023-02-01T00:00:00Z

View Big Object Data in Reports and Dashboards

While Big Objects aren’t directly reportable, you can create custom report types based on Big Object data:

  1. Create an Apex class that queries the Big Object and returns the data as a wrapper object.
  2. Create a custom report type based on this Apex class.
  3. Build reports and dashboards using this custom report type.

SOQL with Big Objects

When using SOQL with Big Objects, keep these points in mind:

  • Queries must use indexed fields in the WHERE clause.
  • JOINs are not supported.
  • Aggregate functions are limited (COUNT is supported).
  • LIMIT clause is required and cannot exceed 10,000 records.

Big Objects in Salesforce Limitations

Although Big Objects offer significant advantages for large-scale data storage, they come with certain limitations:

1. Immutable Schema: Once deployed, the schema of a Big Object cannot be modified. You cannot add or change fields after deployment.

2. Limited SOQL Support:

    • Only indexed fields can be used in WHERE clauses.
    • JOINs are not supported.
    • Limited aggregate functions (e.g., COUNT is allowed, but others like SUM or AVG are not).
    • SOQL queries on Big Objects require a LIMIT clause (maximum of 10,000 records).

3. No Support for Standard Features:

    • Big Objects cannot be used with certain Salesforce features like formulas, validation rules, or triggers.
    • They also cannot be referenced in Salesforce reports, dashboards, or workflow rules.

4. Asynchronous Operations: Data manipulation, such as inserts or deletes, must be done asynchronously using Database.insertAsync() and Database.deleteAsync().

5. Reporting and Dashboards: Big Objects data cannot be directly included in standard Salesforce reports and dashboards. You’ll need custom solutions or external integrations to visualize this data.

Conclusion

Salesforce Big Objects provide a powerful solution for managing large-scale data within the Salesforce ecosystem. By leveraging this feature, organizations can unlock new possibilities in data analysis, historical tracking, and integration with external big data systems. As data continues to grow exponentially, tools like Big Objects will become increasingly crucial for businesses aiming to harness the full potential of their information assets.

Sign up with saasguru today and dive into 30+ Salesforce Certification Courses, tackle 50+ Mock Exams, and get hands-on with 50+ Salesforce Labs. Elevate your skills, boost your confidence, and become the Salesforce consultant you’ve always aspired to be. 

Don’t wait—start your journey with saasguru now and lead the way in Salesforce excellence!

Frequently Asked Questions (FAQs)

1. What’s the maximum number of records a Big Object can hold? 

Big Objects can hold billions of records, with no specific upper limit defined by Salesforce.

2. Can I modify a Big Object’s schema after deployment? 

No, Big Object schemas are immutable after deployment. Careful planning is essential.

3. How do Big Objects differ from standard custom objects? 

Big Objects are designed for massive scale, have different querying mechanisms, and cannot be used in all standard Salesforce features.

4. Are there limits on the number of Big Objects I can create? 

Yes, the number of Big Objects you can create depends on your Salesforce edition and license.

5. Can I use Big Objects in Salesforce formulas or validation rules? 

No, Big Objects cannot be referenced in standard formulas or validation rules due to their unique nature.

Table of Contents

Subscribe & Get Closer to Your Salesforce Dream Career!

Get tips from accomplished Salesforce professionals delivered directly to your inbox.

Looking for Career Upgrade?

Book a free counselling session with our Course Advisor.

By providing your contact details, you agree to our Terms of use & Privacy Policy

Unlock Your AI -Powered Assistant

Gain Exclusive Access to Your Salesforce Copilot

Related Articles

Salesforce Job Market in 2025: Key Trends and Factors You Should Know

Explore the 2025 Salesforce job market trends, key factors, and strategies to thrive in an evolving digital landscape. Read now!

Humans of Salesforce – Sara Hernandez

Discover how Sara Hernandez transformed from an ‘Accidental Admin’ into a passionate Salesforce trailblazer. Read now!

New courses launched by IITs in 2024

Explore IITs’ new 2024 courses in Salesforce, AI, Data Science, Robotics & more. Advance your career with industry-aligned programs!