SlideShare une entreprise Scribd logo
1  sur  29
Enterprise Application
Performance
Distributed Caching
Tito Moreira
Solution Architect - Experts Team
Performance Hurdles
• Application code
○ Slow Queries / too many accesses to database
○ Slow Extensions
○ Large ViewState / Session
• Infrastructure
○ Database
○ Network
Caching helps, right?
Caching helps, right?
There are only two hard things in Computer Science:
cache invalidation and naming things.
-- Phil Karlton
Out-Of-the-Box Caching in OutSystems
• Queries
• Actions
• WebBlocks
• Screens
Out-Of-the-Box Caching in OutSystems
in-memory process
(local server cache)
• Queries
• Actions
• WebBlocks
• Screens
Considerations when using local server caching
• It shares resources (memory) with other apps in the same OutSystems
Front End
• Data in cache is not consistent across ≠ servers
• Not fitted to store hundreds of Megabytes of data
• It’s entirely managed by OS platform
○ Developers cannot control the cache entry keys
○ It is not possible to store local variables, e.g. lists of Structures
○ Cache invalidation mechanisms is somehow limited
• Does not escalate well with the number of Servers
○ First hit in each local Server cache is always a “Miss”, however this can
be dealt with using Warm-up procedures.
Data consistency using local server caching
What is Distributed Caching?
Distributed Cache concepts
• Stores the cache on dedicated infrastructure resources
○ Distributed cache has different scalability needs
• Maintains the infrastructure server caches synchronized
○ Every server in the distributed cache infrastructure should have the same data for
a cache entry.
• Makes the cached data remotely available to all Front-Ends in a
transparent way
○ Front-Ends don’t have any knowledge about the distributed cache infrastructure
• It is complementary to the OutSystems built-in cache
○ Distributed cache does not replace the local cache, it is used in addition to it in
order to overcome certain local cache limitations inherent to that approach (e.g.
cache data coeherence).
General Distributed Cache Infrastructure
Load BalancerUser
Cache protocol (over TCP/IP)
HTTP Requests
Internal Network
(haProxy or other)
Patterns to Populate a Distributed Cache
• On Demand / Cache Aside / Read-Through
○ The application tries to retrieve data from cache, when there’s a “miss”
the application is responsible for storing the data in the cache so it will be
available next time.
○ To implement Write-Through the Cache should be updated whenever the
records are.
MyApp (UI) DataServices_CS
DB
Distributed Cache
infrastructure2
1
3Encapsulates Entities,
providing Read or Write user Actions
Consumes data
related Actions
Tries to read from
cache
On cache miss, data
is read from DB
CacheConnector
4
Data is updated in Cache, to
be available on next access
Patterns to Populate a Distributed Cache
• Background Data Push
○ Timer background Action “pushes” data into the distributed cache on a
regular schedule. Any consumer application pulls the same data from the
cache without being responsible for updating the cache data.
MyApp (UI) DataServices_CS
DB
Distributed Cache
infrastructure2
1
3
Encapsulates Entities,
providing Read or Write user Actions
Consumes data
related Actions
Updates cache on a
regular interval
CacheSync_CS
Writes should
invalidate cache!
CacheConnector
Patterns to Populate a Distributed Cache
On-Demand Background Data Push
High frequency of data
change
Good
(cache can be updated immediately on the Write
use Action)
Bad
(background process makes high frequency
cache updates not feasible)
Exposed Write operations Good
(cache is updated on demand)
Bad
(there might be conflicts between Write
operations and background process - locking
required)
Performance on first
access
Bad
(cache miss requires a DB read and cache
update)
Good
(there shouldn’t be any cache misses - all data
should be cached ahead)
Cache of large blocks of
Data
Bad
(small amounts of data only, since caching is
done synchronously on cache misses)
Good
(caching of big chunks of data is done
asynchronously)
Benefits from using Distributed Caching
So what? How can I benefit from it?
• Access cached data from anywhere
○ Actions, Extensions, external applications, etc
• Get stats about what is stored
• Relief data from Session
• Store significant amounts of pre-processed data
○ Yes, Gigabytes of Query data!
• Load cache data from background processes
○ It opens an entire spectrum of initialization possibilities
• It’s easier to scale cache Servers than DB servers
Distributed Cache
• Get stats about what is stored (most providers)
When to use Distributed Cache?
When to use Distributed Caching
• Don’t use it if:
○ There are just a few Front End Servers (1 or 2)
○ Your Apps won’t have a significant amount of traffic
○ Your Apps don’t suffer from performance issues
○ You want to replace OutSystems local cache function entirely
■ Distributed Cache is a complementary component, and should be used in
very specific scenarios!
When to use Distributed Caching
• You should consider using it if:
○ You have more than 3 Front End Servers and you might need to
scale even further
○ You have public-facing Web apps that display “static” data.
○ Your data changes often making local caches invalid
○ You need 100% control over the cache
○ You need to share state between Servers without using Database
or Session
Recommended way to deploy a
Distributed Cache
Distributed Cache deploy recommendations
• Don’t install Distributed Cache services in OutSystems servers
• Use a different infrastructure for the Distributed Cache servers
• If in the OS Cloud, it’s advised to use AWS Elastic Cache in the same
VPC
• Plan for the Memory and CPU requirements of the Distributed Cache
servers
○ Requests/sec, Reads/Writes, Size of cached data
• Keep the Distributed Cache servers in the same network as the OS
servers
○ Without firewalls, proxies or similiar in between ( < latency)
Managing Distributed Cache
• Data remains cached even after a release (different infrastructure)
○ Not managed by Lifetime (Lifetime plugin for Cache purge?)
• Cached data should to be purged whenever there is a release
○ Data model might have changed
○ Data from previous release might be incompatible with latest release
○ Cached data requirements might be different for the new release
• Cached data initialization is possible with external processes
• Distributed Caching locking mechanisms depend on implementation
(Redis ≠ Memcached)
• Distributed Caching resources should be monitored independently of
OS Front-Ends
dmCache
a Distributed Cache Connector
Introducing dmCache
• dmCache is a Forge component that:
○ Provides actions to store/read OS data types and Records
○ Abstracts the developer from the Distributed Cache protocol and implementation
○ Helps the developer generate Cache entry keys:
■ Global (viewable by all applications)
■ Application
■ Session
■ Web Request
Using dmCache
Supported Cache Providers in dmCache
• Memcached
• Redis
• Couchbase
• AWS Elastic Cache
• Azure Redis Cache
dmCache in Action!
(Demo)
We’ll be back in 5 min to answer
your questions
Thank you!

Contenu connexe

Tendances

Tendances (20)

Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr SarnaDatabase Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
Database Performance at Scale Masterclass: Driver Strategies by Piotr Sarna
 
Multi-tenant Database Design for SaaS
Multi-tenant Database Design for SaaSMulti-tenant Database Design for SaaS
Multi-tenant Database Design for SaaS
 
Scylla Summit 2022: How to Migrate a Counter Table for 68 Billion Records
Scylla Summit 2022: How to Migrate a Counter Table for 68 Billion RecordsScylla Summit 2022: How to Migrate a Counter Table for 68 Billion Records
Scylla Summit 2022: How to Migrate a Counter Table for 68 Billion Records
 
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystemsTechnical Webinar: By the (Play) Book: The Agile Practice at OutSystems
Technical Webinar: By the (Play) Book: The Agile Practice at OutSystems
 
Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017Multi-Datacenter Kafka - Strata San Jose 2017
Multi-Datacenter Kafka - Strata San Jose 2017
 
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DBDistributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
Distributed Databases Deconstructed: CockroachDB, TiDB and YugaByte DB
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
 
C* Summit 2013: How Not to Use Cassandra by Axel Liljencrantz
C* Summit 2013: How Not to Use Cassandra by Axel LiljencrantzC* Summit 2013: How Not to Use Cassandra by Axel Liljencrantz
C* Summit 2013: How Not to Use Cassandra by Axel Liljencrantz
 
Distributed Transactions are dead, long live distributed transaction!
Distributed Transactions are dead, long live distributed transaction!Distributed Transactions are dead, long live distributed transaction!
Distributed Transactions are dead, long live distributed transaction!
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
 
collectd & PostgreSQL
collectd & PostgreSQLcollectd & PostgreSQL
collectd & PostgreSQL
 
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
Database Performance at Scale Masterclass: Database Internals by Pavel Emelya...
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
Scylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and Beyond
Scylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and BeyondScylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and Beyond
Scylla Summit 2022: The Future of Consensus in ScyllaDB 5.0 and Beyond
 
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the UglyKubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
Kubernetes Summit 2021: Multi-Cluster - The Good, the Bad and the Ugly
 
0 to 60 With Outsystems
0 to 60 With Outsystems0 to 60 With Outsystems
0 to 60 With Outsystems
 
Diving into Delta Lake: Unpacking the Transaction Log
Diving into Delta Lake: Unpacking the Transaction LogDiving into Delta Lake: Unpacking the Transaction Log
Diving into Delta Lake: Unpacking the Transaction Log
 
Evolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesEvolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best Practices
 
OutSystems Platform Troubleshooting
OutSystems Platform TroubleshootingOutSystems Platform Troubleshooting
OutSystems Platform Troubleshooting
 

En vedette

Outsystems_Brochure_Web
Outsystems_Brochure_WebOutsystems_Brochure_Web
Outsystems_Brochure_Web
Steve Rotter
 

En vedette (13)

OutSystems - Bimodal Bakeoff
OutSystems - Bimodal Bakeoff OutSystems - Bimodal Bakeoff
OutSystems - Bimodal Bakeoff
 
OutSystems - Go Fast or Go Home
OutSystems - Go Fast or Go Home OutSystems - Go Fast or Go Home
OutSystems - Go Fast or Go Home
 
State of application development - 2017 research report
State of application development - 2017 research reportState of application development - 2017 research report
State of application development - 2017 research report
 
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise ArchitectureTraining Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10
 
Training Webinar: Cover your bases - a security webinar
Training Webinar: Cover your bases - a security webinarTraining Webinar: Cover your bases - a security webinar
Training Webinar: Cover your bases - a security webinar
 
Training Webinar: Top front-end techniques for OutSystems
 Training Webinar: Top front-end techniques for OutSystems Training Webinar: Top front-end techniques for OutSystems
Training Webinar: Top front-end techniques for OutSystems
 
Training Webinar - Wireframing made easy
Training Webinar - Wireframing made easyTraining Webinar - Wireframing made easy
Training Webinar - Wireframing made easy
 
OutSystems - Digital Realities Webinar
OutSystems - Digital Realities WebinarOutSystems - Digital Realities Webinar
OutSystems - Digital Realities Webinar
 
App Development Disrupted: Answers and results from the 2017 State Of App Dev...
App Development Disrupted: Answers and results from the 2017 State Of App Dev...App Development Disrupted: Answers and results from the 2017 State Of App Dev...
App Development Disrupted: Answers and results from the 2017 State Of App Dev...
 
Training Webinar: From a bad to an awesome user experience - Training Webinar
Training Webinar: From a bad to an awesome user experience - Training WebinarTraining Webinar: From a bad to an awesome user experience - Training Webinar
Training Webinar: From a bad to an awesome user experience - Training Webinar
 
Application Lifetime Management
Application Lifetime ManagementApplication Lifetime Management
Application Lifetime Management
 
Outsystems_Brochure_Web
Outsystems_Brochure_WebOutsystems_Brochure_Web
Outsystems_Brochure_Web
 

Similaire à Training Webinar: Enterprise application performance with distributed caching

Introduction to Data Storage and Cloud Computing
Introduction to Data Storage and Cloud ComputingIntroduction to Data Storage and Cloud Computing
Introduction to Data Storage and Cloud Computing
Rutuja751147
 

Similaire à Training Webinar: Enterprise application performance with distributed caching (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
 
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.
 
Flashy prefetching for high performance flash drives
Flashy prefetching for high performance flash drivesFlashy prefetching for high performance flash drives
Flashy prefetching for high performance flash drives
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache framework
 
Introduction to Data Storage and Cloud Computing
Introduction to Data Storage and Cloud ComputingIntroduction to Data Storage and Cloud Computing
Introduction to Data Storage and Cloud Computing
 
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!
 
Java one2015 - Work With Hundreds of Hot Terabytes in JVMs
Java one2015 - Work With Hundreds of Hot Terabytes in JVMsJava one2015 - Work With Hundreds of Hot Terabytes in JVMs
Java one2015 - Work With Hundreds of Hot Terabytes in JVMs
 
Managing Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using ElasticsearchManaging Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using Elasticsearch
 
Optimizing Latency-Sensitive Queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-Sensitive Queries for Presto at Facebook: A Collaboration ...Optimizing Latency-Sensitive Queries for Presto at Facebook: A Collaboration ...
Optimizing Latency-Sensitive Queries for Presto at Facebook: A Collaboration ...
 
Development of concurrent services using In-Memory Data Grids
Development of concurrent services using In-Memory Data GridsDevelopment of concurrent services using In-Memory Data Grids
Development of concurrent services using In-Memory Data Grids
 
Performance Tuning
Performance TuningPerformance Tuning
Performance Tuning
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Memory Management.pdf
Memory Management.pdfMemory Management.pdf
Memory Management.pdf
 
Lecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptxLecture-7 Main Memroy.pptx
Lecture-7 Main Memroy.pptx
 
Data Lake and the rise of the microservices
Data Lake and the rise of the microservicesData Lake and the rise of the microservices
Data Lake and the rise of the microservices
 
Data warehouse 26 exploiting parallel technologies
Data warehouse  26 exploiting parallel technologiesData warehouse  26 exploiting parallel technologies
Data warehouse 26 exploiting parallel technologies
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
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
 
Backup and Disaster Recovery in Hadoop
Backup and Disaster Recovery in Hadoop Backup and Disaster Recovery in Hadoop
Backup and Disaster Recovery in Hadoop
 

Plus de OutSystems

Plus de OutSystems (20)

Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital MediaInnovating at the Speed of Business in the High-Bandwidth World of Digital Media
Innovating at the Speed of Business in the High-Bandwidth World of Digital Media
 
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative TechnologyBeyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
Beyond “Location”: Informing Real-Estate Decisions Through Innovative Technology
 
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
Beyond Digital Transformation: A Mandate for Disruptive Innovation in the Age...
 
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-OutFrom Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
From Core Systems to Mobile Apps: Digital Transformation from the Inside-Out
 
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
Orchestrating the Art of the Impossible Using Low-Code to Automate Manual Wor...
 
Fast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical ApplicationFast and Furious: Modernizing Clinical Application
Fast and Furious: Modernizing Clinical Application
 
What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?What Is Light BPT and How Can You Use it for Parallel Processing?
What Is Light BPT and How Can You Use it for Parallel Processing?
 
Enrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With LayersEnrich Visually Google Map Information With Layers
Enrich Visually Google Map Information With Layers
 
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
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
 
The 4-Layer Architecture in Practice
The 4-Layer Architecture in PracticeThe 4-Layer Architecture in Practice
The 4-Layer Architecture in Practice
 
Speed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class CitizensSpeed up Development by Turning Web Blocks Into First-Class Citizens
Speed up Development by Turning Web Blocks Into First-Class Citizens
 
Service Actions
Service ActionsService Actions
Service Actions
 
Responsive Ui with Realtime Database
Responsive Ui with Realtime DatabaseResponsive Ui with Realtime Database
Responsive Ui with Realtime Database
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
 
RADS - Rapid Application Design Sprint
RADS - Rapid Application Design SprintRADS - Rapid Application Design Sprint
RADS - Rapid Application Design Sprint
 
Pragmatic Innovation
Pragmatic InnovationPragmatic Innovation
Pragmatic Innovation
 
Troubleshooting Dashboard Performance
Troubleshooting Dashboard PerformanceTroubleshooting Dashboard Performance
Troubleshooting Dashboard Performance
 
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
No API? No Problem! Let the Robot Do Your Work! Web Scraping and Automation W...
 
Neo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems ArchitectNeo in Wonderland: Essential Tools for an Outsystems Architect
Neo in Wonderland: Essential Tools for an Outsystems Architect
 

Dernier

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
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
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
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
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
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
 
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...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 

Training Webinar: Enterprise application performance with distributed caching

  • 1. Enterprise Application Performance Distributed Caching Tito Moreira Solution Architect - Experts Team
  • 2. Performance Hurdles • Application code ○ Slow Queries / too many accesses to database ○ Slow Extensions ○ Large ViewState / Session • Infrastructure ○ Database ○ Network
  • 4. Caching helps, right? There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton
  • 5. Out-Of-the-Box Caching in OutSystems • Queries • Actions • WebBlocks • Screens
  • 6. Out-Of-the-Box Caching in OutSystems in-memory process (local server cache) • Queries • Actions • WebBlocks • Screens
  • 7. Considerations when using local server caching • It shares resources (memory) with other apps in the same OutSystems Front End • Data in cache is not consistent across ≠ servers • Not fitted to store hundreds of Megabytes of data • It’s entirely managed by OS platform ○ Developers cannot control the cache entry keys ○ It is not possible to store local variables, e.g. lists of Structures ○ Cache invalidation mechanisms is somehow limited • Does not escalate well with the number of Servers ○ First hit in each local Server cache is always a “Miss”, however this can be dealt with using Warm-up procedures.
  • 8. Data consistency using local server caching
  • 10. Distributed Cache concepts • Stores the cache on dedicated infrastructure resources ○ Distributed cache has different scalability needs • Maintains the infrastructure server caches synchronized ○ Every server in the distributed cache infrastructure should have the same data for a cache entry. • Makes the cached data remotely available to all Front-Ends in a transparent way ○ Front-Ends don’t have any knowledge about the distributed cache infrastructure • It is complementary to the OutSystems built-in cache ○ Distributed cache does not replace the local cache, it is used in addition to it in order to overcome certain local cache limitations inherent to that approach (e.g. cache data coeherence).
  • 11. General Distributed Cache Infrastructure Load BalancerUser Cache protocol (over TCP/IP) HTTP Requests Internal Network (haProxy or other)
  • 12. Patterns to Populate a Distributed Cache • On Demand / Cache Aside / Read-Through ○ The application tries to retrieve data from cache, when there’s a “miss” the application is responsible for storing the data in the cache so it will be available next time. ○ To implement Write-Through the Cache should be updated whenever the records are. MyApp (UI) DataServices_CS DB Distributed Cache infrastructure2 1 3Encapsulates Entities, providing Read or Write user Actions Consumes data related Actions Tries to read from cache On cache miss, data is read from DB CacheConnector 4 Data is updated in Cache, to be available on next access
  • 13. Patterns to Populate a Distributed Cache • Background Data Push ○ Timer background Action “pushes” data into the distributed cache on a regular schedule. Any consumer application pulls the same data from the cache without being responsible for updating the cache data. MyApp (UI) DataServices_CS DB Distributed Cache infrastructure2 1 3 Encapsulates Entities, providing Read or Write user Actions Consumes data related Actions Updates cache on a regular interval CacheSync_CS Writes should invalidate cache! CacheConnector
  • 14. Patterns to Populate a Distributed Cache On-Demand Background Data Push High frequency of data change Good (cache can be updated immediately on the Write use Action) Bad (background process makes high frequency cache updates not feasible) Exposed Write operations Good (cache is updated on demand) Bad (there might be conflicts between Write operations and background process - locking required) Performance on first access Bad (cache miss requires a DB read and cache update) Good (there shouldn’t be any cache misses - all data should be cached ahead) Cache of large blocks of Data Bad (small amounts of data only, since caching is done synchronously on cache misses) Good (caching of big chunks of data is done asynchronously)
  • 15. Benefits from using Distributed Caching So what? How can I benefit from it? • Access cached data from anywhere ○ Actions, Extensions, external applications, etc • Get stats about what is stored • Relief data from Session • Store significant amounts of pre-processed data ○ Yes, Gigabytes of Query data! • Load cache data from background processes ○ It opens an entire spectrum of initialization possibilities • It’s easier to scale cache Servers than DB servers
  • 16. Distributed Cache • Get stats about what is stored (most providers)
  • 17. When to use Distributed Cache?
  • 18. When to use Distributed Caching • Don’t use it if: ○ There are just a few Front End Servers (1 or 2) ○ Your Apps won’t have a significant amount of traffic ○ Your Apps don’t suffer from performance issues ○ You want to replace OutSystems local cache function entirely ■ Distributed Cache is a complementary component, and should be used in very specific scenarios!
  • 19. When to use Distributed Caching • You should consider using it if: ○ You have more than 3 Front End Servers and you might need to scale even further ○ You have public-facing Web apps that display “static” data. ○ Your data changes often making local caches invalid ○ You need 100% control over the cache ○ You need to share state between Servers without using Database or Session
  • 20. Recommended way to deploy a Distributed Cache
  • 21. Distributed Cache deploy recommendations • Don’t install Distributed Cache services in OutSystems servers • Use a different infrastructure for the Distributed Cache servers • If in the OS Cloud, it’s advised to use AWS Elastic Cache in the same VPC • Plan for the Memory and CPU requirements of the Distributed Cache servers ○ Requests/sec, Reads/Writes, Size of cached data • Keep the Distributed Cache servers in the same network as the OS servers ○ Without firewalls, proxies or similiar in between ( < latency)
  • 22. Managing Distributed Cache • Data remains cached even after a release (different infrastructure) ○ Not managed by Lifetime (Lifetime plugin for Cache purge?) • Cached data should to be purged whenever there is a release ○ Data model might have changed ○ Data from previous release might be incompatible with latest release ○ Cached data requirements might be different for the new release • Cached data initialization is possible with external processes • Distributed Caching locking mechanisms depend on implementation (Redis ≠ Memcached) • Distributed Caching resources should be monitored independently of OS Front-Ends
  • 24. Introducing dmCache • dmCache is a Forge component that: ○ Provides actions to store/read OS data types and Records ○ Abstracts the developer from the Distributed Cache protocol and implementation ○ Helps the developer generate Cache entry keys: ■ Global (viewable by all applications) ■ Application ■ Session ■ Web Request
  • 26. Supported Cache Providers in dmCache • Memcached • Redis • Couchbase • AWS Elastic Cache • Azure Redis Cache
  • 28. We’ll be back in 5 min to answer your questions

Notes de l'éditeur

  1. Developer should be careful with: Initializing the Cache before MyApp needs the Data Public user Actions that write cached data should be avoided since there is a Background process responsible for the cache update More adequate for complex business logic that can be executed in the Background to do calculations
  2. Developer should be careful with: Initializing the Cache before MyApp needs the Data Public user Actions that write cached data should be avoided since there is a Background process responsible for the cache update More adequate for complex business logic that can be executed in the Background to do calculations
  3. Access cached data from anywhere OS Extensions Third party Applications (outside of OS environment) Get stats from what is stored in cache Reads/Writes per second, etc Entries stored per application/user/session Cache data size Relief data from Session