SlideShare a Scribd company logo
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

More Related Content

PPTX
Showcase Hongda
PPT
Web server
PDF
Log File Analysis
PDF
Log file analysis with advertools
PPT
Web Performance & Scalability Tools
PPTX
Asp folders and web configurations
PPTX
Why Oracle Engineered systems - 2013
PPTX
Introduction to Azure DocumentDB
Showcase Hongda
Web server
Log File Analysis
Log file analysis with advertools
Web Performance & Scalability Tools
Asp folders and web configurations
Why Oracle Engineered systems - 2013
Introduction to Azure DocumentDB

What's hot (20)

PPTX
Azure DocumentDB 101
PDF
Introduction to SharePoint for SQLserver DBAs
PPTX
Asp .net folders and web.config
PPT
Module Owb Source Metadata
PPTX
Amazon AWS & IAAS
PPTX
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
PPTX
Sqlite Introduction
PPT
Document Databases & RavenDB
PPTX
MVC-3 Vs Webform
PPTX
RavenDB Presentation
PPTX
Repository 3.7
PDF
Advanced database protocols
PPTX
Move your on prem data to a lake in a Lake in Cloud
PDF
Impala use case @ edge
PPSX
ABCD for etd repositories
PPTX
Cosmosdb graph
PPTX
In Memory Cahce Structure
PPTX
Redux: server side rendering and hot code reload for single-page applications
PPTX
Intro to RavenDB
Azure DocumentDB 101
Introduction to SharePoint for SQLserver DBAs
Asp .net folders and web.config
Module Owb Source Metadata
Amazon AWS & IAAS
SharePoint Framework, React, and Office UI Fabric spc adriatics 2016
Sqlite Introduction
Document Databases & RavenDB
MVC-3 Vs Webform
RavenDB Presentation
Repository 3.7
Advanced database protocols
Move your on prem data to a lake in a Lake in Cloud
Impala use case @ edge
ABCD for etd repositories
Cosmosdb graph
In Memory Cahce Structure
Redux: server side rendering and hot code reload for single-page applications
Intro to RavenDB
Ad

Similar to Platform cache in Salesforce (20)

PDF
Platform Cache
PDF
Platform Cache (DF15 session)
PDF
Maximize Apex Performance with Platform Cache
PPTX
Platform cache
PPTX
Increase Salesforce Performance using Platform Cache Demo
PPTX
Enhance salesforce application performance using lightning platform cache
PDF
Salesforce Wave Analytics
PDF
Caching in Distributed Environment
PPTX
Cache-Aside Cloud Design Pattern
PDF
DataArchiva-Whitepaper-2020 (1).pdf
PPT
10 Cache Implementation
PPTX
Training Webinar: Enterprise application performance with distributed caching
PPTX
Managing Large Amounts of Data with Salesforce
PPTX
HTTP Caching.pptx
PDF
Caching Data in OutSystems: A Tale of Gains Without Pain
PDF
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
PDF
JCON World 2023 - Cache, but Cache Wisely.pdf
PPTX
Distributed Cache with dot microservices
PDF
In-memory Data Management Trends & Techniques
PDF
High Scale Relational Storage at Salesforce Built with Apache HBase and Apach...
Platform Cache
Platform Cache (DF15 session)
Maximize Apex Performance with Platform Cache
Platform cache
Increase Salesforce Performance using Platform Cache Demo
Enhance salesforce application performance using lightning platform cache
Salesforce Wave Analytics
Caching in Distributed Environment
Cache-Aside Cloud Design Pattern
DataArchiva-Whitepaper-2020 (1).pdf
10 Cache Implementation
Training Webinar: Enterprise application performance with distributed caching
Managing Large Amounts of Data with Salesforce
HTTP Caching.pptx
Caching Data in OutSystems: A Tale of Gains Without Pain
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
JCON World 2023 - Cache, but Cache Wisely.pdf
Distributed Cache with dot microservices
In-memory Data Management Trends & Techniques
High Scale Relational Storage at Salesforce Built with Apache HBase and Apach...
Ad

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Spectroscopy.pptx food analysis technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
MIND Revenue Release Quarter 2 2025 Press Release
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
sap open course for s4hana steps from ECC to s4
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

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.