SlideShare a Scribd company logo
1 of 43
Download to read offline
Caching in OutSystems
A Tale of Gains without Pain
Helena Lameiro
Senior Engineer @ NTT Data
2022-02-23
1
… another presentation
on performance !!!
Agenda
Caching concepts
When and why to use Cache?
1
OutSystems Built-in Cache
How it works, slightly under the hood
Cache invalidation
Best practices and considerations
Other Server-Side Caching Resources
Application Cache component
Distributed Caching
Caching Client-Side
Mobile and Reactive
IndexedDB
2
3
4 2
1
Caching concepts
3
4
So, What Is Cache All About?
Temporary store fetched data from
server in fast memory or local resource
Improve performance
Better user experience
Data displayed to user faster
Data are available faster on next
requests
5
When To Cache Data?
● Elements fetched from databases or
external systems with low mutability
Lot of requests = Same Response
● Impact end-user experience
● Overload on system resources
● Elements with controlled scope
parameters (user session)
● Data consistency !
● Data changes frequently.
● Caching mechanism is hard to maintain
● System Architecture already has
several cached components on external
systems or DB
(Caching mess)
Don’t Cache!
Cache!
2
OutSystems Built-in Cache
6
7
“Cache in Minutes” Property - Where To Find It?
Server Logic:
● Server Actions
● Aggregates
● SQL Nodes
Traditional Web:
● Web Blocks
(without submit or ajax submit)
On previous OutSystems versions:
● Screens
● Consumed SOAP methods
8
OutSystems’ Built-In Cache – How It Works (I)
RAM-based
● All front-end servers
● One stored instance per server
● Always first miss
Factories with more than one front-end
● First miss on each front-end
Cache expires
● “Cache in Minutes” property
Caching instance is defined by:
● Front-end
● Input Parameters
● Consumer modules and reference type
(weak or strong)
● Tenant in multi-tenant app
Not available on personal environments (no RabbitMQ)
9
OutSystems’ Built-In Cache – How It Works (II)
1st Request
Application
Request
Cache
Missed
Data source
Fetched
Data
Cache
Back
Further Requests
Application
Request
Cached
Data
Cache Cached
10
OutSystems’ Built-In Cache – How It Works (III)
Cached Requests
Application
Request
Cache
Cached
Data
Cached
Cache expired
Application
Request
Cache
Data source
Expired
Fetched
Data
Cache
Back
11
OutSystems’ Built-In Cache – Parameters
Caching Actions is only possible if input parameters are not a binary
or complex type.
12
OutSystems’ Built-In Cache – Parameters
Caching Actions is only possible if input parameters are not a binary
or complex type.
13
OutSystems’ Built-In Cache – How It Works (III)
Server vs. Service Actions
Flow with Server Actions – Strong dependency
● Action logic is executed in the context of each consumer module.
● Cached instances may differ by consumer module.
Flow with a Service Actions – Weak dependency
● Cache is defined at the consumer module that holds the service
action.
● All its consumers have access to previous cached data (per FE).
14
Flow with Server Actions – Strong dependency
Same Parameters - Different consumers
Next
Request
Data source
Fetched
Data
Cache
Back
Cache
Missed
End User Module 1
Application
Request
Entry
Data source
Fetched
Data
Cache
Back
Cache
Missed
End User Module 2
Application
Request
Entry
15
Flow with Service Action – Weak dependency
Same Parameters - Different consumers
End User Module 1
Application
Request
End User Module 2
Application
Request
Cached
Data
Next
Request
Data source
Fetched
Data
Cache
Back
Cache
Missed
Entry
Cache Cached
Entry
16
OutSystems’ Built-In Cache – Site Properties
● Loaded by the server.
● Hold data that has to be available across the module.
● Cached for faster access.
● Should be updated manually in Service Center.
● Isolate site properties in separate module ([ModuleName]_Config).
Updating site properties invalidates the cache of the module and requires the
properties to be reloaded from the database.
17
Some common use cases
Bootstraps, data migration bulk operation with
repetition of data fetched
18
Some common use cases
Data fetched from external resources used very
frequently
19
Some common use cases
Generic actions commonly used on most
applications
20
Some common use cases
Heavy calculation logic or request that is
commonly requested
21
OutSystems’ Built-In Cache – Cache Invalidation (I)
“There are only two hard things in
Computer Science:
Cache Invalidation and Naming Things.”
Phil Karlton
22
OutSystems’ Built-In Cache – Cache Invalidation (I)
Cache invalidation is hard to control:
● All or nothing
● Performance expensive
(forcing evaluation on next usage)
● Possible problems with logic
(outdated values)
23
OutSystems’ Built-In Cache – How Cache Can Be “Cleaned”
Cache in minutes property control
● Cache expired
Logic
● New request forcing change on input
parameter value (context or dummy).
● System actions:
○ EspaceInvalidateCache
○ TenantInvalidateCache
System and Infrastructure
● RAM memory overrun
● Front-end server reboots
● Module is published
● Service Center – redeploy published version
24
OutSystems’ Built-In Cache – How Cache Can Be “Cleaned”
Cache in minutes property control
● Cache expired
Logic
● New request forcing change on input
parameter value (context or dummy).
● System actions:
○ EspaceInvalidateCache
○ TenantInvalidateCache
System and Infrastructure
● RAM memory overrun
● Front-end server reboots
● Module is published
● Service Center – redeploy published version
performance impact during the first
access of an application
25
OutSystems’ Built-In Cache – Cache Invalidation in
OutSystem 11 (III)
Cache Invalidation Service
● Underlying mechanism – publish/subscribe via RabbitMQ
● Notifies each of the front-end servers that cached values are
evicted.
● When cache invalidation occurs for a module or a tenant:
1. All applications watching for changes on these
elements are notified.
2. Flag their local copies as dirty.
3. Set to reevaluation on new requests.
26
OutSystems’ Built-In Cache –
Implementation Best Practices (I)
Avoid caching isolated
Aggregates or Queries
Add _cached suffix to server
action with cache
● Description should indicate that action is cached, its
purpose, and for how long.
● Identify Parameters with specific cache context.
27
OutSystems’ Built-In Cache –
Implementation Best Practices (II)
Use a dummy cache invalidation
parameter to control Cache
Avoid cached actions without
input parameters
28
OutSystems’ Built-In Cache –
Implementation Best Practices (III)
Define the way you want cache to occur Configure cache to your use case
● Short vs. Long Cache
● Warming cache or Background
Loading (via timer)
● Performance Bottlenecks
29
OutSystems’ Built-In Cache –
Some considerations
RAM memory is also shared to run your application logic
● Don’t over cache
● Cache in minutes should be the least possible for you business case
● Check for Performance Bottlenecks
● Be gentle on cache invalidation
●
3
Other Server-Side Caching
Resources
30
31
Distributed Cache
32
Distributed Cache - when to use?
● +3 Front End Servers
● public-facing Web apps with “static”
data.
● Shared data with some mutability
● Need 100% control over cache
● Need to share state between Servers
without using Database or Session
● 1 or 2 Front End Servers
● Low amount of traffic
● No performance issues
● Trying to replace entirely built-in
mechanism!
Don’t use it!
Can use it!
33
Distributed Cache - patterns
Cache aside
Background Data Push
3
Caching Client - Side
34
35
Mobile Application – Client-Side
● Use a Specific Sync Unit.
● Client variable or local entity attribute with cache
timeout and last sync.
● Avoid first miss with warm-up.
● Sync local data if cache evicted
○ update cache timeout and last sync
● Mechanism of cache invalidation to ensure data
consistency.
Optimize Data For Your Use Cases Using Hot Cache
Save cached data on local storage with cache synchronization
Be careful with sensitive data storage.
What about
Caching Client-Side
in Reactive Web?
36
37
Mobile and Reactive Web Applications – Client Side (II)
● Basic data types
● Key Value structure
● Add a last sync timestamp
● Verify last sync against cache in minutes value
● Avoid first miss
● Sync data if cache evicted
● Ensure a cache invalidation mechanism
Web Storage API
Client Variables or Web Storage API handling
Be careful with sensitive data storage
38
Reactive Web Application – Cache Client-Side
● Mimetize local storage entities.
● Storage cached data in IndexedDB in browser – check
availability.
● DB instance must be created first.
● Data created asynchronously.
● Data can be indexed.
Indexed DB
Be careful with sensitive data storage.
39
IndexedDB - Can I Use
40
Cache in Client Side - general consideration
● Avoid first miss - warming strategy
● Sync data if cache evicted (set a condition for eviction)
● Add a last sync timestamp
● Ensure a cache invalidation mechanism on destroy / on app resume (only
on entry module)
● Take into account:
○ Load of data being cached
○ Type of data being cached
○ Logic for retrieve data from cache
Be careful with sensitive data storage
41
It’s DEMO
then...
42
Share your story
● Have you ever used Cache before?
● What were your Use Cases?
● Queries, Screens, WB, Never
● What about client side?
● local storage
● other approaches?
● Advantages and issues that you had with
caching
43
THANK YOU !!!!
Helena Lameiro
Senior Engineer @ everis, an NTT Data company
Linked in

More Related Content

What's hot

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 cachingOutSystems
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best PracticesOutSystems
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesDatabricks
 
Architecture 101 + Libraries
Architecture 101 + LibrariesArchitecture 101 + Libraries
Architecture 101 + LibrariesOutSystems
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365OutSystems
 
Architect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh ArchitectureArchitect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh ArchitectureDatabricks
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksOutSystems
 
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022HostedbyConfluent
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesOutSystems
 
Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)Ryan Blue
 
OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...
OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...
OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...Altinity Ltd
 
Real-Time Event & Stream Processing on MS Azure
Real-Time Event & Stream Processing on MS AzureReal-Time Event & Stream Processing on MS Azure
Real-Time Event & Stream Processing on MS AzureKhalid Salama
 
Branching Your Way to Low-Code Perfection
Branching Your Way to Low-Code PerfectionBranching Your Way to Low-Code Perfection
Branching Your Way to Low-Code PerfectionOutSystems
 
Data Mesh Part 4 Monolith to Mesh
Data Mesh Part 4 Monolith to MeshData Mesh Part 4 Monolith to Mesh
Data Mesh Part 4 Monolith to MeshJeffrey T. Pollock
 
Stl meetup cloudera platform - january 2020
Stl meetup   cloudera platform  - january 2020Stl meetup   cloudera platform  - january 2020
Stl meetup cloudera platform - january 2020Adam Doyle
 
What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...
What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...
What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...OpenText
 
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...Dr. Arif Wider
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsAlluxio, Inc.
 
Evolution from EDA to Data Mesh: Data in Motion
Evolution from EDA to Data Mesh: Data in MotionEvolution from EDA to Data Mesh: Data in Motion
Evolution from EDA to Data Mesh: Data in Motionconfluent
 

What's hot (20)

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
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
Architecture 101 + Libraries
Architecture 101 + LibrariesArchitecture 101 + Libraries
Architecture 101 + Libraries
 
Integrate OutSystems With Office 365
Integrate OutSystems With Office 365Integrate OutSystems With Office 365
Integrate OutSystems With Office 365
 
Architect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh ArchitectureArchitect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh Architecture
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous Tasks
 
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
SQL Extensions to Support Streaming Data With Fabian Hueske | Current 2022
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the Scenes
 
Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)Iceberg: A modern table format for big data (Strata NY 2018)
Iceberg: A modern table format for big data (Strata NY 2018)
 
OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...
OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...
OSA Con 2022 - Apache Iceberg_ An Architectural Look Under the Covers - Alex ...
 
Webinar Data Mesh - Part 3
Webinar Data Mesh - Part 3Webinar Data Mesh - Part 3
Webinar Data Mesh - Part 3
 
Real-Time Event & Stream Processing on MS Azure
Real-Time Event & Stream Processing on MS AzureReal-Time Event & Stream Processing on MS Azure
Real-Time Event & Stream Processing on MS Azure
 
Branching Your Way to Low-Code Perfection
Branching Your Way to Low-Code PerfectionBranching Your Way to Low-Code Perfection
Branching Your Way to Low-Code Perfection
 
Data Mesh Part 4 Monolith to Mesh
Data Mesh Part 4 Monolith to MeshData Mesh Part 4 Monolith to Mesh
Data Mesh Part 4 Monolith to Mesh
 
Stl meetup cloudera platform - january 2020
Stl meetup   cloudera platform  - january 2020Stl meetup   cloudera platform  - january 2020
Stl meetup cloudera platform - january 2020
 
What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...
What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...
What’s new in OpenText Extended ECM Platform CE 20.4 and OpenText Content Sui...
 
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
Data Mesh in Practice - How Europe's Leading Online Platform for Fashion Goes...
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
Evolution from EDA to Data Mesh: Data in Motion
Evolution from EDA to Data Mesh: Data in MotionEvolution from EDA to Data Mesh: Data in Motion
Evolution from EDA to Data Mesh: Data in Motion
 

Similar to Caching Data in OutSystems: A Tale of Gains Without Pain

Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Prolifics
 
IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...
IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...
IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...In-Memory Computing Summit
 
How to Integrate Hyperconverged Systems with Existing SANs
How to Integrate Hyperconverged Systems with Existing SANsHow to Integrate Hyperconverged Systems with Existing SANs
How to Integrate Hyperconverged Systems with Existing SANsDataCore Software
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Lari Hotari
 
Ingestion and Dimensions Compute and Enrich using Apache Apex
Ingestion and Dimensions Compute and Enrich using Apache ApexIngestion and Dimensions Compute and Enrich using Apache Apex
Ingestion and Dimensions Compute and Enrich using Apache ApexApache Apex
 
NetBackup Appliance Family presentation
NetBackup Appliance Family presentationNetBackup Appliance Family presentation
NetBackup Appliance Family presentationSymantec
 
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...GECon_Org Team
 
November 2013 HUG: Real-time analytics with in-memory grid
November 2013 HUG: Real-time analytics with in-memory gridNovember 2013 HUG: Real-time analytics with in-memory grid
November 2013 HUG: Real-time analytics with in-memory gridYahoo Developer Network
 
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Codemotion
 
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformIntro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformApache Apex
 
Caching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session ICaching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session IVMware Tanzu
 
Tokyo AK Meetup Speedtest - Share.pdf
Tokyo AK Meetup Speedtest - Share.pdfTokyo AK Meetup Speedtest - Share.pdf
Tokyo AK Meetup Speedtest - Share.pdfssuser2ae721
 
Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...
Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...
Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...Glen Roberts, CISSP
 
Privacy preserving public auditing for regenerating-code-based
Privacy preserving public auditing for regenerating-code-basedPrivacy preserving public auditing for regenerating-code-based
Privacy preserving public auditing for regenerating-code-basedNagamalleswararao Tadikonda
 
IBM MQ - better application performance
IBM MQ - better application performanceIBM MQ - better application performance
IBM MQ - better application performanceMarkTaylorIBM
 
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...Prolifics
 
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
 New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S... New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...Big Data Spain
 
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB
 

Similar to Caching Data in OutSystems: A Tale of Gains Without Pain (20)

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
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Designing Scalable Applications
Designing Scalable ApplicationsDesigning Scalable Applications
Designing Scalable Applications
 
IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...
IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...
IMCSummit 2015 - Day 1 Developer Track - Implementing Operational Intelligenc...
 
How to Integrate Hyperconverged Systems with Existing SANs
How to Integrate Hyperconverged Systems with Existing SANsHow to Integrate Hyperconverged Systems with Existing SANs
How to Integrate Hyperconverged Systems with Existing SANs
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014
 
Ingestion and Dimensions Compute and Enrich using Apache Apex
Ingestion and Dimensions Compute and Enrich using Apache ApexIngestion and Dimensions Compute and Enrich using Apache Apex
Ingestion and Dimensions Compute and Enrich using Apache Apex
 
NetBackup Appliance Family presentation
NetBackup Appliance Family presentationNetBackup Appliance Family presentation
NetBackup Appliance Family presentation
 
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
GECon2017_Building scalable application with cqrs and event sourcing (a. hars...
 
November 2013 HUG: Real-time analytics with in-memory grid
November 2013 HUG: Real-time analytics with in-memory gridNovember 2013 HUG: Real-time analytics with in-memory grid
November 2013 HUG: Real-time analytics with in-memory grid
 
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
Search on the fly: how to lighten your Big Data - Simona Russo, Auro Rolle - ...
 
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and TransformIntro to Apache Apex - Next Gen Platform for Ingest and Transform
Intro to Apache Apex - Next Gen Platform for Ingest and Transform
 
Caching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session ICaching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session I
 
Tokyo AK Meetup Speedtest - Share.pdf
Tokyo AK Meetup Speedtest - Share.pdfTokyo AK Meetup Speedtest - Share.pdf
Tokyo AK Meetup Speedtest - Share.pdf
 
Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...
Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...
Security Challenges in Cloud Integration - Cloud Security Alliance, Austin Ch...
 
Privacy preserving public auditing for regenerating-code-based
Privacy preserving public auditing for regenerating-code-basedPrivacy preserving public auditing for regenerating-code-based
Privacy preserving public auditing for regenerating-code-based
 
IBM MQ - better application performance
IBM MQ - better application performanceIBM MQ - better application performance
IBM MQ - better application performance
 
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
Creating a Centralized Consumer Profile Management Service with WebSphere Dat...
 
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
 New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S... New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
New usage model for real-time analytics by Dr. WILLIAM L. BAIN at Big Data S...
 
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
 

Recently uploaded

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 

Caching Data in OutSystems: A Tale of Gains Without Pain

  • 1. Caching in OutSystems A Tale of Gains without Pain Helena Lameiro Senior Engineer @ NTT Data 2022-02-23 1
  • 2. … another presentation on performance !!! Agenda Caching concepts When and why to use Cache? 1 OutSystems Built-in Cache How it works, slightly under the hood Cache invalidation Best practices and considerations Other Server-Side Caching Resources Application Cache component Distributed Caching Caching Client-Side Mobile and Reactive IndexedDB 2 3 4 2
  • 4. 4 So, What Is Cache All About? Temporary store fetched data from server in fast memory or local resource Improve performance Better user experience Data displayed to user faster Data are available faster on next requests
  • 5. 5 When To Cache Data? ● Elements fetched from databases or external systems with low mutability Lot of requests = Same Response ● Impact end-user experience ● Overload on system resources ● Elements with controlled scope parameters (user session) ● Data consistency ! ● Data changes frequently. ● Caching mechanism is hard to maintain ● System Architecture already has several cached components on external systems or DB (Caching mess) Don’t Cache! Cache!
  • 7. 7 “Cache in Minutes” Property - Where To Find It? Server Logic: ● Server Actions ● Aggregates ● SQL Nodes Traditional Web: ● Web Blocks (without submit or ajax submit) On previous OutSystems versions: ● Screens ● Consumed SOAP methods
  • 8. 8 OutSystems’ Built-In Cache – How It Works (I) RAM-based ● All front-end servers ● One stored instance per server ● Always first miss Factories with more than one front-end ● First miss on each front-end Cache expires ● “Cache in Minutes” property Caching instance is defined by: ● Front-end ● Input Parameters ● Consumer modules and reference type (weak or strong) ● Tenant in multi-tenant app Not available on personal environments (no RabbitMQ)
  • 9. 9 OutSystems’ Built-In Cache – How It Works (II) 1st Request Application Request Cache Missed Data source Fetched Data Cache Back Further Requests Application Request Cached Data Cache Cached
  • 10. 10 OutSystems’ Built-In Cache – How It Works (III) Cached Requests Application Request Cache Cached Data Cached Cache expired Application Request Cache Data source Expired Fetched Data Cache Back
  • 11. 11 OutSystems’ Built-In Cache – Parameters Caching Actions is only possible if input parameters are not a binary or complex type.
  • 12. 12 OutSystems’ Built-In Cache – Parameters Caching Actions is only possible if input parameters are not a binary or complex type.
  • 13. 13 OutSystems’ Built-In Cache – How It Works (III) Server vs. Service Actions Flow with Server Actions – Strong dependency ● Action logic is executed in the context of each consumer module. ● Cached instances may differ by consumer module. Flow with a Service Actions – Weak dependency ● Cache is defined at the consumer module that holds the service action. ● All its consumers have access to previous cached data (per FE).
  • 14. 14 Flow with Server Actions – Strong dependency Same Parameters - Different consumers Next Request Data source Fetched Data Cache Back Cache Missed End User Module 1 Application Request Entry Data source Fetched Data Cache Back Cache Missed End User Module 2 Application Request Entry
  • 15. 15 Flow with Service Action – Weak dependency Same Parameters - Different consumers End User Module 1 Application Request End User Module 2 Application Request Cached Data Next Request Data source Fetched Data Cache Back Cache Missed Entry Cache Cached Entry
  • 16. 16 OutSystems’ Built-In Cache – Site Properties ● Loaded by the server. ● Hold data that has to be available across the module. ● Cached for faster access. ● Should be updated manually in Service Center. ● Isolate site properties in separate module ([ModuleName]_Config). Updating site properties invalidates the cache of the module and requires the properties to be reloaded from the database.
  • 17. 17 Some common use cases Bootstraps, data migration bulk operation with repetition of data fetched
  • 18. 18 Some common use cases Data fetched from external resources used very frequently
  • 19. 19 Some common use cases Generic actions commonly used on most applications
  • 20. 20 Some common use cases Heavy calculation logic or request that is commonly requested
  • 21. 21 OutSystems’ Built-In Cache – Cache Invalidation (I) “There are only two hard things in Computer Science: Cache Invalidation and Naming Things.” Phil Karlton
  • 22. 22 OutSystems’ Built-In Cache – Cache Invalidation (I) Cache invalidation is hard to control: ● All or nothing ● Performance expensive (forcing evaluation on next usage) ● Possible problems with logic (outdated values)
  • 23. 23 OutSystems’ Built-In Cache – How Cache Can Be “Cleaned” Cache in minutes property control ● Cache expired Logic ● New request forcing change on input parameter value (context or dummy). ● System actions: ○ EspaceInvalidateCache ○ TenantInvalidateCache System and Infrastructure ● RAM memory overrun ● Front-end server reboots ● Module is published ● Service Center – redeploy published version
  • 24. 24 OutSystems’ Built-In Cache – How Cache Can Be “Cleaned” Cache in minutes property control ● Cache expired Logic ● New request forcing change on input parameter value (context or dummy). ● System actions: ○ EspaceInvalidateCache ○ TenantInvalidateCache System and Infrastructure ● RAM memory overrun ● Front-end server reboots ● Module is published ● Service Center – redeploy published version performance impact during the first access of an application
  • 25. 25 OutSystems’ Built-In Cache – Cache Invalidation in OutSystem 11 (III) Cache Invalidation Service ● Underlying mechanism – publish/subscribe via RabbitMQ ● Notifies each of the front-end servers that cached values are evicted. ● When cache invalidation occurs for a module or a tenant: 1. All applications watching for changes on these elements are notified. 2. Flag their local copies as dirty. 3. Set to reevaluation on new requests.
  • 26. 26 OutSystems’ Built-In Cache – Implementation Best Practices (I) Avoid caching isolated Aggregates or Queries Add _cached suffix to server action with cache ● Description should indicate that action is cached, its purpose, and for how long. ● Identify Parameters with specific cache context.
  • 27. 27 OutSystems’ Built-In Cache – Implementation Best Practices (II) Use a dummy cache invalidation parameter to control Cache Avoid cached actions without input parameters
  • 28. 28 OutSystems’ Built-In Cache – Implementation Best Practices (III) Define the way you want cache to occur Configure cache to your use case ● Short vs. Long Cache ● Warming cache or Background Loading (via timer) ● Performance Bottlenecks
  • 29. 29 OutSystems’ Built-In Cache – Some considerations RAM memory is also shared to run your application logic ● Don’t over cache ● Cache in minutes should be the least possible for you business case ● Check for Performance Bottlenecks ● Be gentle on cache invalidation ●
  • 32. 32 Distributed Cache - when to use? ● +3 Front End Servers ● public-facing Web apps with “static” data. ● Shared data with some mutability ● Need 100% control over cache ● Need to share state between Servers without using Database or Session ● 1 or 2 Front End Servers ● Low amount of traffic ● No performance issues ● Trying to replace entirely built-in mechanism! Don’t use it! Can use it!
  • 33. 33 Distributed Cache - patterns Cache aside Background Data Push
  • 35. 35 Mobile Application – Client-Side ● Use a Specific Sync Unit. ● Client variable or local entity attribute with cache timeout and last sync. ● Avoid first miss with warm-up. ● Sync local data if cache evicted ○ update cache timeout and last sync ● Mechanism of cache invalidation to ensure data consistency. Optimize Data For Your Use Cases Using Hot Cache Save cached data on local storage with cache synchronization Be careful with sensitive data storage.
  • 37. 37 Mobile and Reactive Web Applications – Client Side (II) ● Basic data types ● Key Value structure ● Add a last sync timestamp ● Verify last sync against cache in minutes value ● Avoid first miss ● Sync data if cache evicted ● Ensure a cache invalidation mechanism Web Storage API Client Variables or Web Storage API handling Be careful with sensitive data storage
  • 38. 38 Reactive Web Application – Cache Client-Side ● Mimetize local storage entities. ● Storage cached data in IndexedDB in browser – check availability. ● DB instance must be created first. ● Data created asynchronously. ● Data can be indexed. Indexed DB Be careful with sensitive data storage.
  • 40. 40 Cache in Client Side - general consideration ● Avoid first miss - warming strategy ● Sync data if cache evicted (set a condition for eviction) ● Add a last sync timestamp ● Ensure a cache invalidation mechanism on destroy / on app resume (only on entry module) ● Take into account: ○ Load of data being cached ○ Type of data being cached ○ Logic for retrieve data from cache Be careful with sensitive data storage
  • 42. 42 Share your story ● Have you ever used Cache before? ● What were your Use Cases? ● Queries, Screens, WB, Never ● What about client side? ● local storage ● other approaches? ● Advantages and issues that you had with caching
  • 43. 43 THANK YOU !!!! Helena Lameiro Senior Engineer @ everis, an NTT Data company Linked in