SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
New Delhi Salesforce Developer Group
LEARN . SHARE . CELEBRATE . SALESFORCE
Big Objects Explained
About Me (Suraj Gupta)
● Salesforce Technical Consultant at makepositive
● More than 4 years of experience in Salesforce
Domain
● Active member of New Delhi Salesforce Developer
Group
● 161 Trailhead Badges and 4 Superbadge
LEARN . SHARE . CELEBRATE . SALESFORCE
About New Delhi Salesforce DG
● First Revival Meetup in February 2016
● We started with 240 Members
● We are now more than 1,250 members
● Join the Community : http://bit.ly/NewDelhiCommunity
LEARN . SHARE . CELEBRATE . SALESFORCE
What is SalesforceSaturday
● Started by Stephanie Herrera in Austin, Texas
● Meetup every Saturday in a Coffee Shop or
anywhere to share and learn about Salesforce
● It’s now a global phenomena with more than 25
SalesforceSaturday Group over 5 Continents
● For India, it comprises of Online Knowledge
Sharing sessions and Trailhead Challenges
LEARN . SHARE . CELEBRATE . SALESFORCE
What are Big Objects ?
Big objects allow you to store and
manage a massive amount of data
on the Salesforce platform.
LEARN . SHARE . CELEBRATE . SALESFORCE
1,000 100,000 1,000,000 100,000,000 1,000,000,0000
Types of Big Objects
BIG OBJECT
Standard Custom
Object + Permissionset + Package
LEARN . SHARE . CELEBRATE . SALESFORCE
Example:
FieldHistoryArchive
Example:
MyCustomBigObject__b
When you need these objects ?
● To maintain access to historical data for analysis
and other auditing purpose.
● Long term view of your users’ salesforce usages
LEARN . SHARE . CELEBRATE . SALESFORCE
Now what Big Objects means..
● You can create them through metadata API .
● These only supports object and permission.
● Supports SOQL
● Supports Salesforce Lightning and Classic.
● Does Not support transactions that includes big
objects, standard and custom objects
● You can’t use triggers, flows, processes, and the
Salesforce app.
● You can create up to 100 big objects per org.
LEARN . SHARE . CELEBRATE . SALESFORCE
How to create a custom Big Object ..
You can only create Big Object via metadata API. Once you
define and deploy, it will appear in the setup.
OBJECT
file
PERMISSIONSET
file
PACKAGE
file
LEARN . SHARE . CELEBRATE . SALESFORCE
Metadata for Custom Big Objects..
Custom Object
● deploymentStatus (Deployed)
● fields ( CustomField[ ] )
● fullName ( string )
● indexes ( index[] )
● label (string)
● pluralLabel (string)
Custom Field
● fullName (string)
● label (string)
● length (int)
● pluralLabel (string)
● precision (int)
● referenceTo (string)
● relationshipName (string)
● required (boolean)
● scale (int)
● type (field type)
DateTime
Lookup
Number
Text
LongTextArea
Index Field
● name
● sortDirection
LEARN . SHARE . CELEBRATE . SALESFORCE
Populating Big Objects
● Create a .csv file with header and use Bulk or SOAP API to
upload the data.
● Loading the data via Apex.
○ database.insertImmediate();
LEARN . SHARE . CELEBRATE . SALESFORCE
<!-- Define the record -->
<PhoneBook__b> pb = new PhoneBook__b();
pb.FirstName__c = "John";
pb.LastName__c = "Smith";
pb.Address__c = "1 Market St";
pb.PhoneNumber__c = "555-1212";
<!-- Insert the record, which creates a new record -->
database.insertImmediate(pb);
<!-- Modify a field in the index -->
pb.Address__c = "1 Market St, San Francisco, CA";
<!-- Insert the record, creating a new record because the primary key has changed -->
database.insertImmediate(pb);
<!-- Modify a field not included in the index -->
pb.PhoneNumber__c = "800-555-1212";
<!-- Insert the record, which updates the second record because the index is the same -->
database.insertImmediate(pb);
Querying Big Objects
● SOQL : You can query big objects using a subset of standard SOQL
commands. In this case, you don’t have to wait for the results. The queried
record returned are immediately for use in Apex.
● Async SOQL : You can also use this when you have to manage millions
and millions of records. In this case, you have to wait for the results due to
size of the data. You can schedules and runs queries asynchronously in the
background, so it can run queries that normally time out with regular SOQL.
LEARN . SHARE . CELEBRATE . SALESFORCE
Things to remember..
● Big Objects can be queried using SOQL and Async SOQL.
● Async SOQL uses a subset of SOQL commands.
● You don’t have to worry about queries timing out in case of Async
SOQL, because it runs in background.
● You can also use Async SOQL on Standard Objects, Custom
Objects.
● Async SOQL is implemented via Chatter REST API.
● You can use Async SOQL When You don’t need to do aggregate
queries or filtering outside of the index..
LEARN . SHARE . CELEBRATE . SALESFORCE
SOQL on Big Objects
● When using SOQL on Big Objects, you have to build query starting from the first
field defined in the index, without skipping any fields between the first and last
field in the query.
○ for example, You have 3 fields in your Index, then you can’t create a query
using only the first and third fields.
● You can use comparison operators =, <, >, <=, >=, or IN on the last field in your
query.
● Any prior fields in your query can only use the = operator.
● Operators Like ( !=, LIKE, NOT IN, EXCLUDES, and INCLUDES ) aren’t valid in any
query involving big objects.
LEARN . SHARE . CELEBRATE . SALESFORCE
Example SOQL
Assume you have a big object in which Index are defined by LastName__c,
FirstName__c and PhoneNumber__c.
SELECT LastName__c, FirstName__c, PhoneNumber__c
FROM Phone_Book__b
WHERE LastName__c='Kelly' AND FirstName__c='Charlie' AND
PhoneNumber__c='2155555555'
SELECT LastName__c, FirstName__c, PhoneNumber__c
FROM Phone_Book__b
WHERE LastName__c='Kelly' AND PhoneNumber__c='2155555555'
This query specifies all three fields in the index. In this case, the filter on PhoneNumber__c can
be a range.
This query doesn’t work because of a gap in the query where FirstName__c should be.
SELECT OldValue, NewValue
FROM FieldHistoryArchive
WHERE FieldHistoryType='Opportunity’ AND Field= ‘stage’
Standard SOQL
Async SOQL on Big Objects
There are two ways to use Async SOQL on Big Objects.
● Query small amount of data and put them into a custom object, so that you can
use them into your reports, dashboards, or other analytic tool.
● To create a manageable dataset is through coarse aggregations. Aggregate
functions supported by Async SOQL : AVG(field), COUNT(field), COUNT_DISTINCT(field),
SUM(field), MIN(field), MAX(field)
Forming Your Query:
There are some required fields :
● query (String)
● targetObject (String)
● targetFieldMap (Map<String, String>)
Example URL : https://yourInstance.salesforce.com/services/data/v41.0/async-queries/
LEARN . SHARE . CELEBRATE . SALESFORCE
Example Async SOQL
{
"query": "SELECT firstField__c, secondField__c FROM SourceObject__c",
"operation": "insert",
"targetObject": "TargetObject__c",
"targetFieldMap": {"firstField__c":"firstFieldTarget__c",
"secondField__c":"secondFieldTarget__c"
},
"targetValueMap": {"$JOB_ID":"BackgroundOperationLookup__c",
"Copy fields from source to
target":"BackgroundOperationDescription__c"
}
}
POST Request Body :
LEARN . SHARE . CELEBRATE . SALESFORCE
Example Async SOQL continued.
{
"jobId": "08PD000000003kiT",
"message": "",
"query": "SELECT firstField__c, secondField__c FROM SourceObject__c",
"status": "New",
"targetObject": "TargetObject__c",
"targetFieldMap": {"firstField__c":"firstFieldTarget__c",
"secondField__c":"secondFieldTarget__c"
},
"targetValueMap": {"$JOB_ID":"BackgroundOperationLookup__c",
"Copy fields from source to
target":"BackgroundOperationDescription__c"
}
}
POST Response Body :
LEARN . SHARE . CELEBRATE . SALESFORCE
Demo
Demo
Links are attached to
above references
LEARN . SHARE . CELEBRATE . SALESFORCE
LEARN . SHARE . CELEBRATE . SALESFORCE
Q&A
References
● Big Object Implementation Guide: Async SOQL
● Big Object Implementation Guide: SOQL with Big Objects
● TrailheaDX 2017 Session: Async SOQL—Big Data Computing for Force.com
● Big Object Implementation Guide: Running Async SOQL Queries
● Big Object Implementation Guide: Supported SOQL Commands
● Trailhead Module : Big Object Basics
Links are attached to
above references
LEARN . SHARE . CELEBRATE . SALESFORCE
Follow Me
Twitter
@surajSFDC
Facebook
https://www.facebook.com/suraj1108
LinkedIn
https://www.linkedin.com/in/suraj1108/
LEARN . SHARE . CELEBRATE . SALESFORCE
Follow New Delhi Salesforce DG
Twitter
@newdelhisfdcdug
Meetup.com
http://www.meetup.com/New-Delhi-Salesforce-Platform-Develo
per-User-Group
Success Community
http://sforce.co/1oc0lQA
LEARN . SHARE . CELEBRATE . SALESFORCE

Contenu connexe

Similaire à #SalesforceSaturday : Salesforce BIG Objects Explained

Advanced query parsing techniques
Advanced query parsing techniquesAdvanced query parsing techniques
Advanced query parsing techniques
lucenerevolution
 
Building a real time, big data analytics platform with solr
Building a real time, big data analytics platform with solrBuilding a real time, big data analytics platform with solr
Building a real time, big data analytics platform with solr
lucenerevolution
 

Similaire à #SalesforceSaturday : Salesforce BIG Objects Explained (20)

Advanced Relevancy Ranking
Advanced Relevancy RankingAdvanced Relevancy Ranking
Advanced Relevancy Ranking
 
Advanced query parsing techniques
Advanced query parsing techniquesAdvanced query parsing techniques
Advanced query parsing techniques
 
Handling of Large Data by Salesforce
Handling of Large Data by SalesforceHandling of Large Data by Salesforce
Handling of Large Data by Salesforce
 
Salesforce Basic Development
Salesforce Basic DevelopmentSalesforce Basic Development
Salesforce Basic Development
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Salesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins Group
Salesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins GroupSalesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins Group
Salesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins Group
 
Discover deep insights with Salesforce Einstein Analytics and Discovery
Discover deep insights with Salesforce Einstein Analytics and DiscoveryDiscover deep insights with Salesforce Einstein Analytics and Discovery
Discover deep insights with Salesforce Einstein Analytics and Discovery
 
Salesforce Summer 14 Release
Salesforce Summer 14 ReleaseSalesforce Summer 14 Release
Salesforce Summer 14 Release
 
CLEDevs All about Tests
CLEDevs All about TestsCLEDevs All about Tests
CLEDevs All about Tests
 
LDV.pptx
LDV.pptxLDV.pptx
LDV.pptx
 
LDV-v2.pptx
LDV-v2.pptxLDV-v2.pptx
LDV-v2.pptx
 
Luke Cushanick Admin Tips and Tricks for Salesforce Trailblazer Community Chr...
Luke Cushanick Admin Tips and Tricks for Salesforce Trailblazer Community Chr...Luke Cushanick Admin Tips and Tricks for Salesforce Trailblazer Community Chr...
Luke Cushanick Admin Tips and Tricks for Salesforce Trailblazer Community Chr...
 
2018 data warehouse features in spark
2018   data warehouse features in spark2018   data warehouse features in spark
2018 data warehouse features in spark
 
Building a real time big data analytics platform with solr
Building a real time big data analytics platform with solrBuilding a real time big data analytics platform with solr
Building a real time big data analytics platform with solr
 
Building a real time, big data analytics platform with solr
Building a real time, big data analytics platform with solrBuilding a real time, big data analytics platform with solr
Building a real time, big data analytics platform with solr
 
Salesforce Spring 20 Highlights
Salesforce Spring 20 HighlightsSalesforce Spring 20 Highlights
Salesforce Spring 20 Highlights
 
Spark Machine Learning: Adding Your Own Algorithms and Tools with Holden Kara...
Spark Machine Learning: Adding Your Own Algorithms and Tools with Holden Kara...Spark Machine Learning: Adding Your Own Algorithms and Tools with Holden Kara...
Spark Machine Learning: Adding Your Own Algorithms and Tools with Holden Kara...
 
Elasticsearch an overview
Elasticsearch   an overviewElasticsearch   an overview
Elasticsearch an overview
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
 
20 tips and tricks with the Autonomous Database
20 tips and tricks with the Autonomous Database20 tips and tricks with the Autonomous Database
20 tips and tricks with the Autonomous Database
 

Plus de Atul Gupta(8X)

Meetup with kavindra : New Delhi Salesforce Developer Group
Meetup with kavindra : New Delhi Salesforce Developer GroupMeetup with kavindra : New Delhi Salesforce Developer Group
Meetup with kavindra : New Delhi Salesforce Developer Group
Atul Gupta(8X)
 

Plus de Atul Gupta(8X) (20)

Developer Week 2019 Delhi + Spring 19 Features
Developer Week 2019 Delhi + Spring 19 FeaturesDeveloper Week 2019 Delhi + Spring 19 Features
Developer Week 2019 Delhi + Spring 19 Features
 
Engagement Studio, Pardot at Developer Week 2019
Engagement Studio, Pardot at Developer Week 2019Engagement Studio, Pardot at Developer Week 2019
Engagement Studio, Pardot at Developer Week 2019
 
Dreamforce 2018 Global Gathering
Dreamforce 2018 Global Gathering Dreamforce 2018 Global Gathering
Dreamforce 2018 Global Gathering
 
Introduction to Salesforce UI API
Introduction to Salesforce UI APIIntroduction to Salesforce UI API
Introduction to Salesforce UI API
 
TrailheaDX Global Gathering: Agenda and Introduction
TrailheaDX Global Gathering: Agenda and IntroductionTrailheaDX Global Gathering: Agenda and Introduction
TrailheaDX Global Gathering: Agenda and Introduction
 
Building Next-Gen Communities With Lightning Series : Session#01 : Virtual #S...
Building Next-Gen Communities With Lightning Series : Session#01 : Virtual #S...Building Next-Gen Communities With Lightning Series : Session#01 : Virtual #S...
Building Next-Gen Communities With Lightning Series : Session#01 : Virtual #S...
 
Virtual #SalesforceSaturday : Salesforce Connect with Cross Org Adaptor
Virtual #SalesforceSaturday : Salesforce Connect with Cross Org AdaptorVirtual #SalesforceSaturday : Salesforce Connect with Cross Org Adaptor
Virtual #SalesforceSaturday : Salesforce Connect with Cross Org Adaptor
 
#SalesforceSaturday Spring18 Release Highlights by Manish Thaduri
#SalesforceSaturday Spring18 Release Highlights by Manish Thaduri#SalesforceSaturday Spring18 Release Highlights by Manish Thaduri
#SalesforceSaturday Spring18 Release Highlights by Manish Thaduri
 
Success Story and Dreamforce Experience : Jaipur User Group DF17 Global Gathe...
Success Story and Dreamforce Experience : Jaipur User Group DF17 Global Gathe...Success Story and Dreamforce Experience : Jaipur User Group DF17 Global Gathe...
Success Story and Dreamforce Experience : Jaipur User Group DF17 Global Gathe...
 
Test Classes in Salesforce
Test Classes in SalesforceTest Classes in Salesforce
Test Classes in Salesforce
 
Dreamforce Global Gathering : New Delhi Salesforce DG & Gurgaon WIT
Dreamforce Global Gathering : New Delhi Salesforce DG & Gurgaon WITDreamforce Global Gathering : New Delhi Salesforce DG & Gurgaon WIT
Dreamforce Global Gathering : New Delhi Salesforce DG & Gurgaon WIT
 
Developer to Consultant : Transformation Tips #SalesforceSaturday
Developer to Consultant : Transformation Tips #SalesforceSaturdayDeveloper to Consultant : Transformation Tips #SalesforceSaturday
Developer to Consultant : Transformation Tips #SalesforceSaturday
 
Spring 17 Salesforce Viewing Party : New Delhi Salesforce Developer Group
Spring 17 Salesforce Viewing Party : New Delhi Salesforce Developer GroupSpring 17 Salesforce Viewing Party : New Delhi Salesforce Developer Group
Spring 17 Salesforce Viewing Party : New Delhi Salesforce Developer Group
 
Meetup with kavindra : New Delhi Salesforce Developer Group
Meetup with kavindra : New Delhi Salesforce Developer GroupMeetup with kavindra : New Delhi Salesforce Developer Group
Meetup with kavindra : New Delhi Salesforce Developer Group
 
Marketing Cloud, SalesforceSaturday
Marketing Cloud, SalesforceSaturdayMarketing Cloud, SalesforceSaturday
Marketing Cloud, SalesforceSaturday
 
Live Agent Setup SalesforceSaturday
Live Agent Setup SalesforceSaturdayLive Agent Setup SalesforceSaturday
Live Agent Setup SalesforceSaturday
 
Data Loader Command Line Interface
Data Loader Command Line InterfaceData Loader Command Line Interface
Data Loader Command Line Interface
 
How to list your app on AppExchange
How to list your app on AppExchangeHow to list your app on AppExchange
How to list your app on AppExchange
 
Force.com Migration Tool
Force.com Migration ToolForce.com Migration Tool
Force.com Migration Tool
 
TrailheaDX Viewing Party - New Delhi Salesforce DG
TrailheaDX Viewing Party - New Delhi Salesforce DGTrailheaDX Viewing Party - New Delhi Salesforce DG
TrailheaDX Viewing Party - New Delhi Salesforce DG
 

Dernier

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Dernier (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

#SalesforceSaturday : Salesforce BIG Objects Explained

  • 1. New Delhi Salesforce Developer Group LEARN . SHARE . CELEBRATE . SALESFORCE Big Objects Explained
  • 2. About Me (Suraj Gupta) ● Salesforce Technical Consultant at makepositive ● More than 4 years of experience in Salesforce Domain ● Active member of New Delhi Salesforce Developer Group ● 161 Trailhead Badges and 4 Superbadge LEARN . SHARE . CELEBRATE . SALESFORCE
  • 3. About New Delhi Salesforce DG ● First Revival Meetup in February 2016 ● We started with 240 Members ● We are now more than 1,250 members ● Join the Community : http://bit.ly/NewDelhiCommunity LEARN . SHARE . CELEBRATE . SALESFORCE
  • 4. What is SalesforceSaturday ● Started by Stephanie Herrera in Austin, Texas ● Meetup every Saturday in a Coffee Shop or anywhere to share and learn about Salesforce ● It’s now a global phenomena with more than 25 SalesforceSaturday Group over 5 Continents ● For India, it comprises of Online Knowledge Sharing sessions and Trailhead Challenges LEARN . SHARE . CELEBRATE . SALESFORCE
  • 5. What are Big Objects ? Big objects allow you to store and manage a massive amount of data on the Salesforce platform. LEARN . SHARE . CELEBRATE . SALESFORCE 1,000 100,000 1,000,000 100,000,000 1,000,000,0000
  • 6. Types of Big Objects BIG OBJECT Standard Custom Object + Permissionset + Package LEARN . SHARE . CELEBRATE . SALESFORCE Example: FieldHistoryArchive Example: MyCustomBigObject__b
  • 7. When you need these objects ? ● To maintain access to historical data for analysis and other auditing purpose. ● Long term view of your users’ salesforce usages LEARN . SHARE . CELEBRATE . SALESFORCE
  • 8. Now what Big Objects means.. ● You can create them through metadata API . ● These only supports object and permission. ● Supports SOQL ● Supports Salesforce Lightning and Classic. ● Does Not support transactions that includes big objects, standard and custom objects ● You can’t use triggers, flows, processes, and the Salesforce app. ● You can create up to 100 big objects per org. LEARN . SHARE . CELEBRATE . SALESFORCE
  • 9. How to create a custom Big Object .. You can only create Big Object via metadata API. Once you define and deploy, it will appear in the setup. OBJECT file PERMISSIONSET file PACKAGE file LEARN . SHARE . CELEBRATE . SALESFORCE
  • 10. Metadata for Custom Big Objects.. Custom Object ● deploymentStatus (Deployed) ● fields ( CustomField[ ] ) ● fullName ( string ) ● indexes ( index[] ) ● label (string) ● pluralLabel (string) Custom Field ● fullName (string) ● label (string) ● length (int) ● pluralLabel (string) ● precision (int) ● referenceTo (string) ● relationshipName (string) ● required (boolean) ● scale (int) ● type (field type) DateTime Lookup Number Text LongTextArea Index Field ● name ● sortDirection LEARN . SHARE . CELEBRATE . SALESFORCE
  • 11. Populating Big Objects ● Create a .csv file with header and use Bulk or SOAP API to upload the data. ● Loading the data via Apex. ○ database.insertImmediate(); LEARN . SHARE . CELEBRATE . SALESFORCE <!-- Define the record --> <PhoneBook__b> pb = new PhoneBook__b(); pb.FirstName__c = "John"; pb.LastName__c = "Smith"; pb.Address__c = "1 Market St"; pb.PhoneNumber__c = "555-1212"; <!-- Insert the record, which creates a new record --> database.insertImmediate(pb); <!-- Modify a field in the index --> pb.Address__c = "1 Market St, San Francisco, CA"; <!-- Insert the record, creating a new record because the primary key has changed --> database.insertImmediate(pb); <!-- Modify a field not included in the index --> pb.PhoneNumber__c = "800-555-1212"; <!-- Insert the record, which updates the second record because the index is the same --> database.insertImmediate(pb);
  • 12. Querying Big Objects ● SOQL : You can query big objects using a subset of standard SOQL commands. In this case, you don’t have to wait for the results. The queried record returned are immediately for use in Apex. ● Async SOQL : You can also use this when you have to manage millions and millions of records. In this case, you have to wait for the results due to size of the data. You can schedules and runs queries asynchronously in the background, so it can run queries that normally time out with regular SOQL. LEARN . SHARE . CELEBRATE . SALESFORCE
  • 13. Things to remember.. ● Big Objects can be queried using SOQL and Async SOQL. ● Async SOQL uses a subset of SOQL commands. ● You don’t have to worry about queries timing out in case of Async SOQL, because it runs in background. ● You can also use Async SOQL on Standard Objects, Custom Objects. ● Async SOQL is implemented via Chatter REST API. ● You can use Async SOQL When You don’t need to do aggregate queries or filtering outside of the index.. LEARN . SHARE . CELEBRATE . SALESFORCE
  • 14. SOQL on Big Objects ● When using SOQL on Big Objects, you have to build query starting from the first field defined in the index, without skipping any fields between the first and last field in the query. ○ for example, You have 3 fields in your Index, then you can’t create a query using only the first and third fields. ● You can use comparison operators =, <, >, <=, >=, or IN on the last field in your query. ● Any prior fields in your query can only use the = operator. ● Operators Like ( !=, LIKE, NOT IN, EXCLUDES, and INCLUDES ) aren’t valid in any query involving big objects. LEARN . SHARE . CELEBRATE . SALESFORCE
  • 15. Example SOQL Assume you have a big object in which Index are defined by LastName__c, FirstName__c and PhoneNumber__c. SELECT LastName__c, FirstName__c, PhoneNumber__c FROM Phone_Book__b WHERE LastName__c='Kelly' AND FirstName__c='Charlie' AND PhoneNumber__c='2155555555' SELECT LastName__c, FirstName__c, PhoneNumber__c FROM Phone_Book__b WHERE LastName__c='Kelly' AND PhoneNumber__c='2155555555' This query specifies all three fields in the index. In this case, the filter on PhoneNumber__c can be a range. This query doesn’t work because of a gap in the query where FirstName__c should be. SELECT OldValue, NewValue FROM FieldHistoryArchive WHERE FieldHistoryType='Opportunity’ AND Field= ‘stage’ Standard SOQL
  • 16. Async SOQL on Big Objects There are two ways to use Async SOQL on Big Objects. ● Query small amount of data and put them into a custom object, so that you can use them into your reports, dashboards, or other analytic tool. ● To create a manageable dataset is through coarse aggregations. Aggregate functions supported by Async SOQL : AVG(field), COUNT(field), COUNT_DISTINCT(field), SUM(field), MIN(field), MAX(field) Forming Your Query: There are some required fields : ● query (String) ● targetObject (String) ● targetFieldMap (Map<String, String>) Example URL : https://yourInstance.salesforce.com/services/data/v41.0/async-queries/ LEARN . SHARE . CELEBRATE . SALESFORCE
  • 17. Example Async SOQL { "query": "SELECT firstField__c, secondField__c FROM SourceObject__c", "operation": "insert", "targetObject": "TargetObject__c", "targetFieldMap": {"firstField__c":"firstFieldTarget__c", "secondField__c":"secondFieldTarget__c" }, "targetValueMap": {"$JOB_ID":"BackgroundOperationLookup__c", "Copy fields from source to target":"BackgroundOperationDescription__c" } } POST Request Body : LEARN . SHARE . CELEBRATE . SALESFORCE
  • 18. Example Async SOQL continued. { "jobId": "08PD000000003kiT", "message": "", "query": "SELECT firstField__c, secondField__c FROM SourceObject__c", "status": "New", "targetObject": "TargetObject__c", "targetFieldMap": {"firstField__c":"firstFieldTarget__c", "secondField__c":"secondFieldTarget__c" }, "targetValueMap": {"$JOB_ID":"BackgroundOperationLookup__c", "Copy fields from source to target":"BackgroundOperationDescription__c" } } POST Response Body : LEARN . SHARE . CELEBRATE . SALESFORCE
  • 19. Demo Demo Links are attached to above references LEARN . SHARE . CELEBRATE . SALESFORCE
  • 20. LEARN . SHARE . CELEBRATE . SALESFORCE Q&A
  • 21. References ● Big Object Implementation Guide: Async SOQL ● Big Object Implementation Guide: SOQL with Big Objects ● TrailheaDX 2017 Session: Async SOQL—Big Data Computing for Force.com ● Big Object Implementation Guide: Running Async SOQL Queries ● Big Object Implementation Guide: Supported SOQL Commands ● Trailhead Module : Big Object Basics Links are attached to above references LEARN . SHARE . CELEBRATE . SALESFORCE
  • 23. Follow New Delhi Salesforce DG Twitter @newdelhisfdcdug Meetup.com http://www.meetup.com/New-Delhi-Salesforce-Platform-Develo per-User-Group Success Community http://sforce.co/1oc0lQA LEARN . SHARE . CELEBRATE . SALESFORCE