Skip to main content

ASYNC SOQL - with Big Objects

Async SOQL

Async SOQL is a method for running SOQL queries when you can’t wait for immediate results. These queries are run in the background over Salesforce big object data. Async SOQL provides a convenient way to query large amounts of data stored in Salesforce.
Async SOQL is implemented as a RESTful API that enables you to run queries in the familiar syntax of SOQL. Because of its asynchronous operation, you can subset, join, and create more complex queries and not be subject to timeout limits. This situation is ideal when you have millions or billions of records and need more performant processing than is possible using synchronous SOQL. The results of each query are deposited into an object you specify, which can be a standard object, custom object, or big object.
The limit for Async SOQL queries is one concurrent query at a time.

Async SOQL Versus SOQL

SOQL and Async SOQL provide many of the same capabilities. So when would you use an Async SOQL query instead of standard SOQL?
Use standard SOQL when:
  • You want to display the results in the UI without having the user wait for results.
  • You want results returned immediately for manipulation within a block of Apex code.
  • You know that the query returns a small amount of data.
Use Async SOQL when:
  • You are querying against millions of records.
  • You want to ensure that your query completes.
  • You do not need to do aggregate queries or filtering outside of the index.

Use Case: Create a Working Dataset with Filtering

A comparison of AsyncQuery versus Data Pipelines
For example, let’s say that you want to analyze the years and years of opportunity history collected by Salesforce. The results could help you identify which current and future opportunities are more likely to close and give you a better picture of your forecast. But because the opportunity history data is stored with all the field history data across the application, the volume of data is too large to query directly. That’s where Async SOQL comes in! You can use it to write a query that extracts a smaller, representative subset of the data that you’re interested. You can store this working dataset in a custom object and use it in reports, dashboards, or any other Lightning Platform feature.

Use Case: Create a Working Dataset with Coarse Aggregations

A comparison of AsyncQuery versus Data Pipelines
With big objects, you can now bring a much finer level of detail into your applications using data that you already have. For example, every interaction an individual has with your marketing campaign is stored as data that you can use, but it’s unwieldy in its raw form. Async SOQL allows you to aggregate that data by campaign and day and to extract the relevant details of the full dataset into a smaller, usable dataset. As in the previous example, the smaller working set can live in a custom object and be used in your reports and dashboards.

Comments

Popular posts from this blog

Define & View Custom Big Object

Define a Custom Big Object: You can define custom big objects with Metadata API or in Setup. After you define and deploy a big object, you can view it or add fields in Setup. After you’ve deployed a big object, you can’t edit or delete the index. To change the index, start over with a new big object. To define a big object in Setup, see Salesforce Help. View a Custom Big Object in Setup After you’ve deployed your custom big object, you can view it by logging in to your organization and, from Setup, entering  Big Objects  in the  Quick Find  box, then selecting  Big Objects . Click the name of a big object, to see its fields and relationships. View a Custom Big Object in Setup After you’ve deployed your custom big object, you can view it by logging in to your organization and, from Setup, entering  Big Objects  in the  Quick Find  box, then selecting  Big Objects . Click the name of a big object, to see its fields and ...

Publish Paltform Events

Publishing Platform Events The Salesforce enterprise messaging platform offers the benefits of event-driven software architectures. Platform events are the event messages (or notifications) that your apps send and receive to take further action. Platform events simplify the process of communicating changes and responding to them without writing complex logic.  Publishers and subscribers communicate with each other through events.  One or more subscribers can listen to the same event and carry out actions. Here we will see how many ways you can able to publish the platform events in Salesforce.  After a platform event has been defined in your Salesforce org, publish event messages from a Salesforce app using processes, flows, or Apex or an external app using Salesforce APIs.Here is the simple platform event object we will be using in the examples here Here are the different ways you can able to publish the platform events in Salesforce Option 1: Using Proces...

Salesforce Platform Events – What are they & how to use

So, what’s platform event in basic terms and how is it helpful to me? Consider this, a platform event is just like another custom object but this would only be referred by external systems to communicate with Salesforce. To put this in a scenario when a certain system posts data on a Salesforce endpoint then that data should be fetched and the data in Salesforce should be updated. Of course, you can use too many lines of code to continuously fetch and retrieve the data from the endpoint or just wait for data to be posted based on which an event shall be triggered and the next processes shall follow. Now, this is where platform event comes into the picture, instead of writing lines and lines of codes and continuously requesting and checking if the data is posted we can just have a platform event trigger notify us and then have your logic do the rest of the heavy lifting. Now, that we have convinced you why Platform events are good, let’s give you a quick walkthrough of it. From you...