SlideShare a Scribd company logo
1 of 32
Download to read offline
Caching for Microservices
Architectures - Session 2
Caching Patterns
Why Microservices Architectures Need a Cache
(covered in webinar #1)
Autonomy Availability Cost Reduction
$
$
Performance
Why Microservices Architectures Need a Cache
(covered in webinar #1)
Autonomy
$
$
Cost ReductionPerformance Availability
In-memory performance
Horizontally scalable
Why Microservices Architectures Need a Cache
(covered in webinar #1)
Autonomy
$
$
Cost ReductionPerformance Availability
Resilient to Server or Availability Zone failures
Recovery process protects against any data loss
Increases the overall availability of data across the system
Why Microservices Architectures Need a Cache
(covered in webinar #1)
Autonomy
$
$
Cost ReductionPerformance Availability
Data APIs and versioning can provide teams with tailored views of data
without changing the backing store(s)
Versioning of Data APIs provides an easier evolutionary path for
changes to the data layer
Why Microservices Architectures Need a Cache
(covered in webinar #1)
Autonomy
$
$
Cost ReductionPerformance Availability
Economical alternative to expensive data access from legacy systems
Provides an on-ramp to a modern architecture while preserving
investments in legacy systems
Today’s Topic
Is There a Pattern To Caching Patterns?
Business use case driven
Online shopping
Ticketing
Risk computations
Isolation vs. Consolidation
Single shared database (anti-pattern)
Database per service
Types of data
Session state caching
Application and user data caching
Data consistency
Synchronous
Asynchronous
Active lifespan of data
Static data
Fast data
Type of integration
Data APIs
Embedded in applications
Separate process
Data Management
Materialized views
Data mirroring
Data integration
Data streams
Query and search
Architecture
Event driven
CQRS
Lifecycle Management
Versioning
Parallel Deployments
Caching Styles
Look-aside
Read-through
Write through
Write behind
If it happens often, and it solves a problem, it’s a pattern.
If it works against solving the problem then it’s an anti-pattern.
What are Software Design Patterns?
Wikipedia for ‘software design patterns’
“... general reusable solution to a commonly occurring problem within a given
context in software design”
Patterns We Will Cover Today
●  Session state caching
●  Caching application generated data, e.g. user data
●  Caching reference data, product data, pricing
●  Cache warming and freshness
●  High availability across servers and availability zones
Session State Caching
Session state caching: a common starting point
▪  Data generated by the application and users -
populates the app’s database
▪  Data about the user such as preferences
▪  Data that is used by the application to do its
job such as product data or pricing
Session State Data Application or User Data
●  Caching session or application state
●  Metadata about the application’s
interactions
●  Useful for business continuity of
operations, and resilience to failures
●  Fast access to state information is critical
for elastic operations
●  Session state caching: session data
available within the scope of a session
Benefits both, user experience, and infrastructure elasticity
Why Use Session State Caching
▪  Capturing and externalizing state information for
improving the user experience
-  State information can be saved in a highly
available cache
▪  Elastic infrastructure for scaling up/down Microservices
-  Multiple application instances share the same
user session context
-  Multiple disparate applications can share the
same user session context?
▪  Improves the infrastructure’s availability
Animation Video
Session State Caching
Demo
Session State Caching
Caching Application Generated Data
Application Data Cache
▪  Works well when ...
-  Same data accessed frequently (read intensive)
-  Large number of concurrent sessions
-  Data that is slow or expensive to access from the backing store
-  No need for handling concurrent updates to the same data
-  User experience driven (performance and availability)
▪  Example: Online shopping
-  Customer preferences
-  Shopping carts
-  Recent history
-  Recommendation engine data
This is how an in-memory cache can horizontally scale
Partitioning (aka Sharding)
Take advantage of the memory and network bandwidth of all members of the cluster
Reference Data is a Prime Candidate for Caching
Application Data Cache
▪  Slowly changing
▪  Modest volumes
▪  Examples
-  Product catalog information: pricing, description, …
-  Geo information
-  Profile information: name, address, preferences
-  HR information
▪  Slowly changing data benefits from cache warming
Cache warming and freshness
(Data streaming)
Streams reduce data latency
Batch vs. Data Streams
Batch Streams
Data scope Queries or processing over all or most
of the data
Queries or processing over data on a
rolling window or most recent data record
Data size Large batches Individual records or micro batches
Performance Latencies in minutes or hours Latencies in order of seconds or
milliseconds
Analytics Complex analytics Simple response functions, aggregates,
and rolling metrics
Tools Batch ETL, monolithic, brittle expensive Scalable, adaptable, cloud-native
Copyright (C) 2017 451 Research LLC
Continuous Data Integration
The key concepts of a
continuous integration and
delivery process can be
applied to the process of
developing, deploying and
managing data integration
pipelines, resulting in
pipelines that are responsive
to changing business and
data processing
requirements.
for Data Integration
Before Cloud
●  Servers were expensive.
●  Software was hard to acquire
and slow to deploy.
●  Nightly batches
●  Integration in large rollouts and
required specialized skills.
Today
●  Lower compute cost
●  Software is core to business value,
developed in-house.
●  Higher data volumes
●  Scale-out architectures
●  Streaming data sources
Why Microservices
Integration flows can leverage this by operating as microservices
that scale independently, and are reusable, and interoperate over
message queues.
Spring Cloud Data Flow (Spring Cloud Stream)
Binding Abstraction Layer
Transport Options
Data Pipeline
Data
Sources
IoT
Pivotal
Cloud
Cache
Cache Warming and Data Freshness
RabbitMQ
Drag and drop visual editor for data pipeline authoring and orchestration
Spring Cloud Data Flow
Platform Leverage for Streaming Data
Backing Services
Transport Options
Pivotal Cloud Foundry
Auto Scaling
Auto Healing
Aggregated
Logging
Integrated
Metrics
Transport
Transparency
Infrastructure
Transparency
Data Pipeline
Visual Design
Integrated
Monitoring
RabbitMQ
© 2015 Pivotal Software, Inc. All rights reserved.
Legacy Systems Modernization at HCSC
●  Event based architecture generates data streams and minimizes data latency
●  Initial load accomplished through synthetic events
●  Spring Cloud Data Flow, RabbitMQ, GemFire (target)
Same logic and flow for both cache warming and updates
High Availability
Animation Video
High Availability
Summary
▪  Session state caching
-  “De-anonymizes” users during a session to improve user experience
-  Is a critical part of how cloud-native apps achieve elasticity
▪  Application data caches can relieve pressure from applications that need
low-latency, high-frequency access to data (hot data)
▪  Reference data is prime candidate for caching
▪  Data streams
-  Can feed a caching layer for use cases that need low-latency access to
fresh data
-  Provide a uniform mechanism for both cache warming as well as the
ongoing freshness of cached data
▪  High availability for applications requires component level availability as well
as system wide mechanisms for resilience after failures
Caching for Microservices Architectures: Session II - Caching Patterns
Caching for Microservices Architectures: Session II - Caching Patterns

More Related Content

What's hot

Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...
HostedbyConfluent
 

What's hot (20)

Migration to Alibaba Cloud
Migration to Alibaba CloudMigration to Alibaba Cloud
Migration to Alibaba Cloud
 
Cloud design principles
Cloud design principlesCloud design principles
Cloud design principles
 
Which Change Data Capture Strategy is Right for You?
Which Change Data Capture Strategy is Right for You?Which Change Data Capture Strategy is Right for You?
Which Change Data Capture Strategy is Right for You?
 
apidays LIVE Australia 2020 - Building an Enterprise Eventing Platform by Gna...
apidays LIVE Australia 2020 - Building an Enterprise Eventing Platform by Gna...apidays LIVE Australia 2020 - Building an Enterprise Eventing Platform by Gna...
apidays LIVE Australia 2020 - Building an Enterprise Eventing Platform by Gna...
 
Einführung: MariaDB heute und unsere Vision für die Zukunft
Einführung: MariaDB heute und unsere Vision für die ZukunftEinführung: MariaDB heute und unsere Vision für die Zukunft
Einführung: MariaDB heute und unsere Vision für die Zukunft
 
IIoT with Kafka and Machine Learning for Supply Chain Optimization In Real Ti...
IIoT with Kafka and Machine Learning for Supply Chain Optimization In Real Ti...IIoT with Kafka and Machine Learning for Supply Chain Optimization In Real Ti...
IIoT with Kafka and Machine Learning for Supply Chain Optimization In Real Ti...
 
Building Stateful applications on Streaming Platforms | Premjit Mishra, Dell ...
Building Stateful applications on Streaming Platforms | Premjit Mishra, Dell ...Building Stateful applications on Streaming Platforms | Premjit Mishra, Dell ...
Building Stateful applications on Streaming Platforms | Premjit Mishra, Dell ...
 
Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...Model-driven and low-code development for event-based systems | Bobby Calderw...
Model-driven and low-code development for event-based systems | Bobby Calderw...
 
Software Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureSoftware Architecture for Cloud Infrastructure
Software Architecture for Cloud Infrastructure
 
Digital Transformation: Highly Resilient Streaming Architecture and Strategies
Digital Transformation: Highly Resilient Streaming Architecture and StrategiesDigital Transformation: Highly Resilient Streaming Architecture and Strategies
Digital Transformation: Highly Resilient Streaming Architecture and Strategies
 
Low-latency real-time data processing at giga-scale with Kafka | John DesJard...
Low-latency real-time data processing at giga-scale with Kafka | John DesJard...Low-latency real-time data processing at giga-scale with Kafka | John DesJard...
Low-latency real-time data processing at giga-scale with Kafka | John DesJard...
 
Modeling microservices using DDD
Modeling microservices using DDDModeling microservices using DDD
Modeling microservices using DDD
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture Pipeline
 
Comparing three data ingestion approaches where Apache Kafka integrates with ...
Comparing three data ingestion approaches where Apache Kafka integrates with ...Comparing three data ingestion approaches where Apache Kafka integrates with ...
Comparing three data ingestion approaches where Apache Kafka integrates with ...
 
Enteras io Introduction
Enteras io IntroductionEnteras io Introduction
Enteras io Introduction
 
Streaming data in the cloud with Confluent and MongoDB Atlas | Robert Waters,...
Streaming data in the cloud with Confluent and MongoDB Atlas | Robert Waters,...Streaming data in the cloud with Confluent and MongoDB Atlas | Robert Waters,...
Streaming data in the cloud with Confluent and MongoDB Atlas | Robert Waters,...
 
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
 
Cloud Design Pattern part2
Cloud Design Pattern part2Cloud Design Pattern part2
Cloud Design Pattern part2
 
Five ways database modernization simplifies your data life
Five ways database modernization simplifies your data lifeFive ways database modernization simplifies your data life
Five ways database modernization simplifies your data life
 
Seamless, Real-Time Data Integration with Connect
Seamless, Real-Time Data Integration with ConnectSeamless, Real-Time Data Integration with Connect
Seamless, Real-Time Data Integration with Connect
 

Similar to Caching for Microservices Architectures: Session II - Caching Patterns

Similar to Caching for Microservices Architectures: Session II - Caching Patterns (20)

ADV Slides: The Evolution of the Data Platform and What It Means to Enterpris...
ADV Slides: The Evolution of the Data Platform and What It Means to Enterpris...ADV Slides: The Evolution of the Data Platform and What It Means to Enterpris...
ADV Slides: The Evolution of the Data Platform and What It Means to Enterpris...
 
Solving enterprise challenges through scale out storage & big compute final
Solving enterprise challenges through scale out storage & big compute finalSolving enterprise challenges through scale out storage & big compute final
Solving enterprise challenges through scale out storage & big compute final
 
Smarter Data Protection And Storage Management Solutions
Smarter Data Protection And Storage Management SolutionsSmarter Data Protection And Storage Management Solutions
Smarter Data Protection And Storage Management Solutions
 
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
Maginatics @ SDC 2013: Architecting An Enterprise Storage Platform Using Obje...
 
Oracle Coherence: in-memory datagrid
Oracle Coherence: in-memory datagridOracle Coherence: in-memory datagrid
Oracle Coherence: in-memory datagrid
 
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...
 
L21 scalability
L21 scalabilityL21 scalability
L21 scalability
 
DM Radio Webinar: Adopting a Streaming-Enabled Architecture
DM Radio Webinar: Adopting a Streaming-Enabled ArchitectureDM Radio Webinar: Adopting a Streaming-Enabled Architecture
DM Radio Webinar: Adopting a Streaming-Enabled Architecture
 
Building Analytic Apps for SaaS: “Analytics as a Service”
Building Analytic Apps for SaaS: “Analytics as a Service”Building Analytic Apps for SaaS: “Analytics as a Service”
Building Analytic Apps for SaaS: “Analytics as a Service”
 
IBM Spectrum Scale Overview november 2015
IBM Spectrum Scale Overview november 2015IBM Spectrum Scale Overview november 2015
IBM Spectrum Scale Overview november 2015
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
SaaS Enablement of your existing application (Cloud Slam 2010)
SaaS Enablement of your existing application (Cloud Slam 2010)SaaS Enablement of your existing application (Cloud Slam 2010)
SaaS Enablement of your existing application (Cloud Slam 2010)
 
Data warehousing in the era of Big Data: Deep Dive into Amazon Redshift
Data warehousing in the era of Big Data: Deep Dive into Amazon RedshiftData warehousing in the era of Big Data: Deep Dive into Amazon Redshift
Data warehousing in the era of Big Data: Deep Dive into Amazon Redshift
 
Delivering Modern Data Protection for VMware Environments
Delivering Modern Data Protection for VMware EnvironmentsDelivering Modern Data Protection for VMware Environments
Delivering Modern Data Protection for VMware Environments
 
TIBCO vs MuleSoft Differentiators
TIBCO vs MuleSoft DifferentiatorsTIBCO vs MuleSoft Differentiators
TIBCO vs MuleSoft Differentiators
 
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
(Speaker Notes Version) Architecting An Enterprise Storage Platform Using Obj...
 
Positioning IBM Flex System 16 Gb Fibre Channel Fabric for Storage-Intensive ...
Positioning IBM Flex System 16 Gb Fibre Channel Fabric for Storage-Intensive ...Positioning IBM Flex System 16 Gb Fibre Channel Fabric for Storage-Intensive ...
Positioning IBM Flex System 16 Gb Fibre Channel Fabric for Storage-Intensive ...
 
Workload Centric Scale-Out Storage for Next Generation Datacenter
Workload Centric Scale-Out Storage for Next Generation DatacenterWorkload Centric Scale-Out Storage for Next Generation Datacenter
Workload Centric Scale-Out Storage for Next Generation Datacenter
 
Data Driven Advanced Analytics using Denodo Platform on AWS
Data Driven Advanced Analytics using Denodo Platform on AWSData Driven Advanced Analytics using Denodo Platform on AWS
Data Driven Advanced Analytics using Denodo Platform on AWS
 

More from VMware Tanzu

More from VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Recently uploaded

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Caching for Microservices Architectures: Session II - Caching Patterns

  • 1. Caching for Microservices Architectures - Session 2 Caching Patterns
  • 2. Why Microservices Architectures Need a Cache (covered in webinar #1) Autonomy Availability Cost Reduction $ $ Performance
  • 3. Why Microservices Architectures Need a Cache (covered in webinar #1) Autonomy $ $ Cost ReductionPerformance Availability In-memory performance Horizontally scalable
  • 4. Why Microservices Architectures Need a Cache (covered in webinar #1) Autonomy $ $ Cost ReductionPerformance Availability Resilient to Server or Availability Zone failures Recovery process protects against any data loss Increases the overall availability of data across the system
  • 5. Why Microservices Architectures Need a Cache (covered in webinar #1) Autonomy $ $ Cost ReductionPerformance Availability Data APIs and versioning can provide teams with tailored views of data without changing the backing store(s) Versioning of Data APIs provides an easier evolutionary path for changes to the data layer
  • 6. Why Microservices Architectures Need a Cache (covered in webinar #1) Autonomy $ $ Cost ReductionPerformance Availability Economical alternative to expensive data access from legacy systems Provides an on-ramp to a modern architecture while preserving investments in legacy systems
  • 8. Is There a Pattern To Caching Patterns? Business use case driven Online shopping Ticketing Risk computations Isolation vs. Consolidation Single shared database (anti-pattern) Database per service Types of data Session state caching Application and user data caching Data consistency Synchronous Asynchronous Active lifespan of data Static data Fast data Type of integration Data APIs Embedded in applications Separate process Data Management Materialized views Data mirroring Data integration Data streams Query and search Architecture Event driven CQRS Lifecycle Management Versioning Parallel Deployments Caching Styles Look-aside Read-through Write through Write behind
  • 9. If it happens often, and it solves a problem, it’s a pattern. If it works against solving the problem then it’s an anti-pattern. What are Software Design Patterns? Wikipedia for ‘software design patterns’ “... general reusable solution to a commonly occurring problem within a given context in software design”
  • 10. Patterns We Will Cover Today ●  Session state caching ●  Caching application generated data, e.g. user data ●  Caching reference data, product data, pricing ●  Cache warming and freshness ●  High availability across servers and availability zones
  • 12. Session state caching: a common starting point ▪  Data generated by the application and users - populates the app’s database ▪  Data about the user such as preferences ▪  Data that is used by the application to do its job such as product data or pricing Session State Data Application or User Data ●  Caching session or application state ●  Metadata about the application’s interactions ●  Useful for business continuity of operations, and resilience to failures ●  Fast access to state information is critical for elastic operations ●  Session state caching: session data available within the scope of a session
  • 13. Benefits both, user experience, and infrastructure elasticity Why Use Session State Caching ▪  Capturing and externalizing state information for improving the user experience -  State information can be saved in a highly available cache ▪  Elastic infrastructure for scaling up/down Microservices -  Multiple application instances share the same user session context -  Multiple disparate applications can share the same user session context? ▪  Improves the infrastructure’s availability
  • 17. Application Data Cache ▪  Works well when ... -  Same data accessed frequently (read intensive) -  Large number of concurrent sessions -  Data that is slow or expensive to access from the backing store -  No need for handling concurrent updates to the same data -  User experience driven (performance and availability) ▪  Example: Online shopping -  Customer preferences -  Shopping carts -  Recent history -  Recommendation engine data
  • 18. This is how an in-memory cache can horizontally scale Partitioning (aka Sharding) Take advantage of the memory and network bandwidth of all members of the cluster
  • 19. Reference Data is a Prime Candidate for Caching Application Data Cache ▪  Slowly changing ▪  Modest volumes ▪  Examples -  Product catalog information: pricing, description, … -  Geo information -  Profile information: name, address, preferences -  HR information ▪  Slowly changing data benefits from cache warming
  • 20. Cache warming and freshness (Data streaming)
  • 21. Streams reduce data latency Batch vs. Data Streams Batch Streams Data scope Queries or processing over all or most of the data Queries or processing over data on a rolling window or most recent data record Data size Large batches Individual records or micro batches Performance Latencies in minutes or hours Latencies in order of seconds or milliseconds Analytics Complex analytics Simple response functions, aggregates, and rolling metrics Tools Batch ETL, monolithic, brittle expensive Scalable, adaptable, cloud-native
  • 22. Copyright (C) 2017 451 Research LLC Continuous Data Integration The key concepts of a continuous integration and delivery process can be applied to the process of developing, deploying and managing data integration pipelines, resulting in pipelines that are responsive to changing business and data processing requirements.
  • 23. for Data Integration Before Cloud ●  Servers were expensive. ●  Software was hard to acquire and slow to deploy. ●  Nightly batches ●  Integration in large rollouts and required specialized skills. Today ●  Lower compute cost ●  Software is core to business value, developed in-house. ●  Higher data volumes ●  Scale-out architectures ●  Streaming data sources Why Microservices Integration flows can leverage this by operating as microservices that scale independently, and are reusable, and interoperate over message queues.
  • 24. Spring Cloud Data Flow (Spring Cloud Stream) Binding Abstraction Layer Transport Options Data Pipeline Data Sources IoT Pivotal Cloud Cache Cache Warming and Data Freshness RabbitMQ
  • 25. Drag and drop visual editor for data pipeline authoring and orchestration Spring Cloud Data Flow
  • 26. Platform Leverage for Streaming Data Backing Services Transport Options Pivotal Cloud Foundry Auto Scaling Auto Healing Aggregated Logging Integrated Metrics Transport Transparency Infrastructure Transparency Data Pipeline Visual Design Integrated Monitoring RabbitMQ
  • 27. © 2015 Pivotal Software, Inc. All rights reserved. Legacy Systems Modernization at HCSC ●  Event based architecture generates data streams and minimizes data latency ●  Initial load accomplished through synthetic events ●  Spring Cloud Data Flow, RabbitMQ, GemFire (target) Same logic and flow for both cache warming and updates
  • 30. Summary ▪  Session state caching -  “De-anonymizes” users during a session to improve user experience -  Is a critical part of how cloud-native apps achieve elasticity ▪  Application data caches can relieve pressure from applications that need low-latency, high-frequency access to data (hot data) ▪  Reference data is prime candidate for caching ▪  Data streams -  Can feed a caching layer for use cases that need low-latency access to fresh data -  Provide a uniform mechanism for both cache warming as well as the ongoing freshness of cached data ▪  High availability for applications requires component level availability as well as system wide mechanisms for resilience after failures