SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
Platform Cache in
Apex
Presented By: Vikas Singh
Agenda:
• What is platform cache
• When Can I Use Platform Cache?
• What Are Cache Partitions?
• Use of Org & Session Cache
• How can we read/write data in cache partition
• Platform Cache consideration
What is platform Cache
• Platform Cache is a memory layer that stores
Salesforce session and org data for later access.
• When you use Platform Cache, your applications
can run faster because they store reusable data
in memory.
• Applications can quickly access this data; they
don’t need to duplicate calculations and requests
to the database on subsequent transactions.
What Are the Types of Platform Cache?
• There are two types of Platform Cache: 

org cache and session cache.
• Org Cache: Org cache stores org-wide data that
anyone in the org can use. Org cache is
accessible across sessions, requests, and org
users and profiles.
• Session Cache: Session cache stores data for an
individual user and is tied to that user’s session.
When Can I Use Platform Cache?
• You can use Platform Cache in your code almost
anywhere you access the same data over and
over. Using cached data improves the
performance of your app.
• Reused throughout a session, or reused across all
users and requests.
• Expensive to compute or retrieve
• Store Data That Doesn’t Change Often
What Are Cache Partitions?
• Partitions let you allocate cache space to
balance usage and performance across apps.
• Caching data to designated partitions ensures
that the cache space isn’t overwritten by other
apps or by less critical data.
•
Create a partition
Store and retrieve values in
the org and session cache.
• // Get partition
• Cache.Org Class
• Cache.session Class
• Cache Key Name Format:
Namespace.Partition.Key
• // Add cache value to the partition.
• Cache.Org.put(Namespace.Partition.Key, value,
timestamp(Optional));
• // Retrieve cache value from the partition
• String cachedRate =
(DataType)orgPart.get('Namespace.Partition.Ke
y');
Platform Cache
Considerations
• Always handle the cache miss
• Data in the cache isn’t encrypted.
• Partitions must adhere to the limits within
Salesforce.
• The session cache can store values up to eight
hours. The org cache can store values up to 48
hours.
• Qs?
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Module Owb Source Metadata
Module Owb Source MetadataModule Owb Source Metadata
Module Owb Source Metadata
Nicholas Goodman
 
Sqlite Introduction
Sqlite IntroductionSqlite Introduction
Sqlite Introduction
Praveen Nair
 
RavenDB Presentation
RavenDB PresentationRavenDB Presentation
RavenDB Presentation
Mark Rodseth
 

Was ist angesagt? (20)

Azure DocumentDB 101
Azure DocumentDB 101Azure DocumentDB 101
Azure DocumentDB 101
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
Asp .net folders and web.config
Asp .net folders and web.configAsp .net folders and web.config
Asp .net folders and web.config
 
Module Owb Source Metadata
Module Owb Source MetadataModule Owb Source Metadata
Module Owb Source Metadata
 
Amazon AWS & IAAS
Amazon AWS & IAASAmazon AWS & IAAS
Amazon AWS & IAAS
 
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
 
Sqlite Introduction
Sqlite IntroductionSqlite Introduction
Sqlite Introduction
 
Document Databases & RavenDB
Document Databases & RavenDBDocument Databases & RavenDB
Document Databases & RavenDB
 
Hive
HiveHive
Hive
 
MVC-3 Vs Webform
MVC-3 Vs WebformMVC-3 Vs Webform
MVC-3 Vs Webform
 
RavenDB Presentation
RavenDB PresentationRavenDB Presentation
RavenDB Presentation
 
Repository 3.7
Repository 3.7Repository 3.7
Repository 3.7
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocols
 
Move your on prem data to a lake in a Lake in Cloud
Move your on prem data to a lake in a Lake in CloudMove your on prem data to a lake in a Lake in Cloud
Move your on prem data to a lake in a Lake in Cloud
 
Impala use case @ edge
Impala use case @ edgeImpala use case @ edge
Impala use case @ edge
 
ABCD for etd repositories
ABCD for etd repositoriesABCD for etd repositories
ABCD for etd repositories
 
Cosmosdb graph
Cosmosdb graphCosmosdb graph
Cosmosdb graph
 
In Memory Cahce Structure
In Memory Cahce StructureIn Memory Cahce Structure
In Memory Cahce Structure
 
Redux: server side rendering and hot code reload for single-page applications
Redux: server side rendering and hot code reload for single-page applicationsRedux: server side rendering and hot code reload for single-page applications
Redux: server side rendering and hot code reload for single-page applications
 
Intro to RavenDB
Intro to RavenDBIntro to RavenDB
Intro to RavenDB
 

Ähnlich wie Platform cache in Salesforce

Ähnlich wie Platform cache in Salesforce (20)

Platform Cache
Platform CachePlatform Cache
Platform Cache
 
Platform Cache (DF15 session)
Platform Cache (DF15 session)Platform Cache (DF15 session)
Platform Cache (DF15 session)
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
Training Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingTraining Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed caching
 
Salesforce Wave Analytics
Salesforce Wave AnalyticsSalesforce Wave Analytics
Salesforce Wave Analytics
 
Overview of the ehcache
Overview of the ehcacheOverview of the ehcache
Overview of the ehcache
 
Cloud patterns at Carleton University
Cloud patterns at Carleton UniversityCloud patterns at Carleton University
Cloud patterns at Carleton University
 
A Unified Platform for Real-time Storage and Processing
A Unified Platform for Real-time Storage and ProcessingA Unified Platform for Real-time Storage and Processing
A Unified Platform for Real-time Storage and Processing
 
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
 
OS UNIT4.pptx
OS UNIT4.pptxOS UNIT4.pptx
OS UNIT4.pptx
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation in
 
How to do Memory Optimizations in Android
How to do Memory Optimizations in AndroidHow to do Memory Optimizations in Android
How to do Memory Optimizations in Android
 
Coherence Overview - OFM Canberra July 2014
Coherence Overview - OFM Canberra July 2014Coherence Overview - OFM Canberra July 2014
Coherence Overview - OFM Canberra July 2014
 
4. (mjk) extreme performance 2
4. (mjk) extreme performance 24. (mjk) extreme performance 2
4. (mjk) extreme performance 2
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Don’t give up, You can... Cache!
Don’t give up, You can... Cache!Don’t give up, You can... Cache!
Don’t give up, You can... Cache!
 
Oracle Database in-Memory Overivew
Oracle Database in-Memory OverivewOracle Database in-Memory Overivew
Oracle Database in-Memory Overivew
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Platform cache in Salesforce

  • 2. Agenda: • What is platform cache • When Can I Use Platform Cache? • What Are Cache Partitions? • Use of Org & Session Cache • How can we read/write data in cache partition • Platform Cache consideration
  • 3. What is platform Cache • Platform Cache is a memory layer that stores Salesforce session and org data for later access. • When you use Platform Cache, your applications can run faster because they store reusable data in memory. • Applications can quickly access this data; they don’t need to duplicate calculations and requests to the database on subsequent transactions.
  • 4. What Are the Types of Platform Cache? • There are two types of Platform Cache: 
 org cache and session cache. • Org Cache: Org cache stores org-wide data that anyone in the org can use. Org cache is accessible across sessions, requests, and org users and profiles. • Session Cache: Session cache stores data for an individual user and is tied to that user’s session.
  • 5. When Can I Use Platform Cache? • You can use Platform Cache in your code almost anywhere you access the same data over and over. Using cached data improves the performance of your app. • Reused throughout a session, or reused across all users and requests. • Expensive to compute or retrieve • Store Data That Doesn’t Change Often
  • 6. What Are Cache Partitions? • Partitions let you allocate cache space to balance usage and performance across apps. • Caching data to designated partitions ensures that the cache space isn’t overwritten by other apps or by less critical data. •
  • 8. Store and retrieve values in the org and session cache. • // Get partition • Cache.Org Class • Cache.session Class
  • 9. • Cache Key Name Format: Namespace.Partition.Key • // Add cache value to the partition. • Cache.Org.put(Namespace.Partition.Key, value, timestamp(Optional)); • // Retrieve cache value from the partition • String cachedRate = (DataType)orgPart.get('Namespace.Partition.Ke y');
  • 10. Platform Cache Considerations • Always handle the cache miss • Data in the cache isn’t encrypted. • Partitions must adhere to the limits within Salesforce. • The session cache can store values up to eight hours. The org cache can store values up to 48 hours.