SlideShare a Scribd company logo
1 of 33
@RADUVUNVULEA
Caching inside serverless
applications 
CLIENT NAME // PRESENTATION NAME // © COPYRIGHT 2020 ENDAVA // CONFIDENTIAL AND PROPRIETARY // VERSION 1.0
Radu Vunvulea
Endava
Microsoft Azure MPV
Microsoft Regional Director
2010: 1st cloud commercial
cloud project
In an O'Reilly survey of 1500 IT professionals in 2019, 40% of
respondents worked at organizations that have adopted
serverless architecture
A 2020 DataDog survey indicated that over 50% of AWS users
are now using the serverless AWS Lambda Function as a
Service (FaaS)
https://www.infoq.com/news/2020/07/future -serverless-architecture/
Why serverless?
Faster time to market
Cost efficiency
Inherent scalability and resilience
Serverless solution Write less code
Event driven Less infrastructure
C#, Java, JavaScript, PowerShell, or Python
Custom Handler (e.g. Go, Rust) Docker
Consumption Plan, Premium
and App Services
Kubernetes - KEDA
Automate deployment
Timeout 5’-30’
Max timeout 10’- oo’*
*guaranteed up to 60’
Request size 100MB
Query length 4096
Max memory 1.5-14GB
(shared at Function App level) GB-s =(number of executions) x (execution duration in
seconds) x (amount of RAM used in GB)
Binding
shared data
Trigger
event + data
connect to another resources how a function is invoked
Bindings
Blob storage
Azure Cosmos DB
Dapr3
Event Grid
Event Hubs
HTTP & webhooks
IoT Hub
Kafka2
Mobile Apps
Notification Hubs
Queue storage
RabbitMQ2
SendGrid
Service Bus
SignalR
Table storage
Timer
Twilio
Triggers
Demo
External resources / caching
FStorage
Stateless Stateful
No state or locks between requests Persist state or locks between requests
Stateful functions
in serverless environment
Behind the scene
an extension that manage state,
checkpoints and restarts
(1) Orchestrator functions
(2) Stateful entities
Entities functions
Durable
Demo
Durable Functions
Collects temporary data Reduce load or response time
Content refresh Optimize bandwidth
Cache
Demo
Static Cache
FCacheSimple, FCache
In memory caching using
static dictionary Simple to use for static content
Error prone for
refreshed content
Impact
Consumption Plan: value refreshed because of running
time
Elastic Premium Plan: pre-warmed with old value, new
scaled instances with refreshed value
App Service Plan: Similar with Elastic, but with more
control
Cache
Demo
Memory Cache
Memory Cache Capability to specify expiration time
Refreshed content time
can be managed
Risk to get the old value still exist but it
is smaller
Impact
Consumption Plan: value refreshed because of running
time
Elastic Premium Plan: pre-warmed with old value, new
scaled instances with refreshed value
App Service Plan: Similar with Elastic, but with more
control
Cache
Demo
Redis Cache
Azure Redis Cache Full control on content
Ability to manage expiration and
consistency
Cache
Easy to scale and manage
Azure Redis Cache During high load you can get
Time-out exceptions
Causes
Plan exceeded
Object size vs single thread
Synchronously access of large objects
Noisy neighbors (C0 plan)
Cache Error
Explanation
The Lazy instance is not thread safe; if the instance is accessed from multiple
threads, its behavior is undefined. Use this mode only when high performance is
crucial and the Lazy instance is guaranteed never to be initialized from more than
one thread. If you use a Lazy constructor that specifies an initialization method
(valueFactory parameter), and if that initialization method throws an exception (or
fails to handle an exception) the first time you call the Value property, then the
exception is cached and thrown again on subsequent calls to the Value property
Final Thoughts
Dedicated solution
(Azure Redis Cache)
External Storage
(Blob Storage, CosmosDB)
Stateful
(Durable Functions, Entity Functions)
Cache
In-memory
(Static Dictionary, Memory Cache)
What are you caching?
DB queries external HTTP calls blob content
configuration data
Configuration Data
Azure Table
Azure Function In-memory cache
LazyLoad
Configuration Data
Azure Table
Azure Function In-memory cache
Changeevent
Event Grid
LazyLoad
Azure Function
Clearcache
Eventhandler
EventPublisher
EventSubscriptions
Expensive Queries / API Calls
100B cache operations a day
Query / API
Azure Function Azure Redis Cache
Azure Function
Azure Function
Expensive Queries / API Calls
100B cache operations a day
Query / API
Azure Function Azure Redis Cache
Azure Function
Azure Function
Smalllatency
(externalcall)
Expensive API Calls
API
Azure Function API Management
Azure Redis Cache
Thank you!
@RaduVunvulea

More Related Content

What's hot

OSDC 2016 - Hybrid Cloud - A Cloud Migration Strategy
OSDC 2016 - Hybrid Cloud - A Cloud Migration StrategyOSDC 2016 - Hybrid Cloud - A Cloud Migration Strategy
OSDC 2016 - Hybrid Cloud - A Cloud Migration Strategy
Schlomo Schapiro
 

What's hot (20)

AWS re:Invent 2016: Fueling Migration: Shortcutting your Application Portfoli...
AWS re:Invent 2016: Fueling Migration: Shortcutting your Application Portfoli...AWS re:Invent 2016: Fueling Migration: Shortcutting your Application Portfoli...
AWS re:Invent 2016: Fueling Migration: Shortcutting your Application Portfoli...
 
OSDC 2016 - Hybrid Cloud - A Cloud Migration Strategy
OSDC 2016 - Hybrid Cloud - A Cloud Migration StrategyOSDC 2016 - Hybrid Cloud - A Cloud Migration Strategy
OSDC 2016 - Hybrid Cloud - A Cloud Migration Strategy
 
The Cloud Adoption Program for Financial Services
The Cloud Adoption Program for Financial ServicesThe Cloud Adoption Program for Financial Services
The Cloud Adoption Program for Financial Services
 
cloud economics - Toronto FSI Symposium - October 2016
cloud economics - Toronto FSI Symposium - October 2016cloud economics - Toronto FSI Symposium - October 2016
cloud economics - Toronto FSI Symposium - October 2016
 
Migrating Traditional Apps from On-Premises to the Hybrid Cloud
Migrating Traditional Apps from On-Premises to the Hybrid CloudMigrating Traditional Apps from On-Premises to the Hybrid Cloud
Migrating Traditional Apps from On-Premises to the Hybrid Cloud
 
AWS Fallbeispiele zur Digitalen Transformation - AWS Cloud Web Day für Mittel...
AWS Fallbeispiele zur Digitalen Transformation - AWS Cloud Web Day für Mittel...AWS Fallbeispiele zur Digitalen Transformation - AWS Cloud Web Day für Mittel...
AWS Fallbeispiele zur Digitalen Transformation - AWS Cloud Web Day für Mittel...
 
Migrating to Public Cloud
Migrating to Public CloudMigrating to Public Cloud
Migrating to Public Cloud
 
Cloud Migration Strategy - IT Transformation with Cloud
Cloud Migration Strategy - IT Transformation with CloudCloud Migration Strategy - IT Transformation with Cloud
Cloud Migration Strategy - IT Transformation with Cloud
 
AWS Partner Webcast - Step by Step Plan to Update and Migrate Microsoft Wind...
AWS Partner Webcast -  Step by Step Plan to Update and Migrate Microsoft Wind...AWS Partner Webcast -  Step by Step Plan to Update and Migrate Microsoft Wind...
AWS Partner Webcast - Step by Step Plan to Update and Migrate Microsoft Wind...
 
Migrating your Existing Applications to the Cloud
Migrating your Existing Applications to the CloudMigrating your Existing Applications to the Cloud
Migrating your Existing Applications to the Cloud
 
Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?Day 4 - Cloud Migration - But How?
Day 4 - Cloud Migration - But How?
 
So You’ve Decided to Buy Cloud, Now What? | AWS Public Sector Summit 2016
So You’ve Decided to Buy Cloud, Now What? | AWS Public Sector Summit 2016So You’ve Decided to Buy Cloud, Now What? | AWS Public Sector Summit 2016
So You’ve Decided to Buy Cloud, Now What? | AWS Public Sector Summit 2016
 
Migrating Enterprise Applications to AWS: Best Practices & Techniques (ENT303...
Migrating Enterprise Applications to AWS: Best Practices & Techniques (ENT303...Migrating Enterprise Applications to AWS: Best Practices & Techniques (ENT303...
Migrating Enterprise Applications to AWS: Best Practices & Techniques (ENT303...
 
Demystifying Cloud Economics - How to Build an Investment Case for Scale Migr...
Demystifying Cloud Economics - How to Build an Investment Case for Scale Migr...Demystifying Cloud Economics - How to Build an Investment Case for Scale Migr...
Demystifying Cloud Economics - How to Build an Investment Case for Scale Migr...
 
Running Enterprise Workloads on AWS
Running Enterprise Workloads on AWSRunning Enterprise Workloads on AWS
Running Enterprise Workloads on AWS
 
Accelerate Your Cloud Migration Journey.pdf
Accelerate Your Cloud Migration Journey.pdfAccelerate Your Cloud Migration Journey.pdf
Accelerate Your Cloud Migration Journey.pdf
 
Cloud Migration with AZURE - I'm SURE!
Cloud Migration with AZURE - I'm SURE!Cloud Migration with AZURE - I'm SURE!
Cloud Migration with AZURE - I'm SURE!
 
Cloud Migration: Moving Data and Infrastructure to the Cloud
Cloud Migration: Moving Data and Infrastructure to the CloudCloud Migration: Moving Data and Infrastructure to the Cloud
Cloud Migration: Moving Data and Infrastructure to the Cloud
 
Cloud Migration Insights Forum, Melbourne
Cloud Migration Insights Forum, MelbourneCloud Migration Insights Forum, Melbourne
Cloud Migration Insights Forum, Melbourne
 
Five keys to successful cloud migration
Five keys to successful cloud migrationFive keys to successful cloud migration
Five keys to successful cloud migration
 

Similar to Caching inside serverless applications

Aws what is cloud computing deck 08 14 13
Aws what is cloud computing deck 08 14 13Aws what is cloud computing deck 08 14 13
Aws what is cloud computing deck 08 14 13
Amazon Web Services
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
Tushar Gandhi
 
December 15 — Cloud Computing and Hosting
December 15 — Cloud Computing and HostingDecember 15 — Cloud Computing and Hosting
December 15 — Cloud Computing and Hosting
webhostingguy
 

Similar to Caching inside serverless applications (20)

Cloud computing What Why How
Cloud computing What Why HowCloud computing What Why How
Cloud computing What Why How
 
Cloud Has Become the New Normal: TCS
Cloud Has Become the New Normal: TCS Cloud Has Become the New Normal: TCS
Cloud Has Become the New Normal: TCS
 
AWS Webcast - Best Practices in Architecting for the Cloud
AWS Webcast - Best Practices in Architecting for the CloudAWS Webcast - Best Practices in Architecting for the Cloud
AWS Webcast - Best Practices in Architecting for the Cloud
 
Fundamentals of Cloud Computing & AWS
Fundamentals of Cloud Computing & AWSFundamentals of Cloud Computing & AWS
Fundamentals of Cloud Computing & AWS
 
How a National Transportation Software Provider Migrated a Mission-Critical T...
How a National Transportation Software Provider Migrated a Mission-Critical T...How a National Transportation Software Provider Migrated a Mission-Critical T...
How a National Transportation Software Provider Migrated a Mission-Critical T...
 
AWS webinar what is cloud computing 13 09 11
AWS webinar what is cloud computing 13 09 11AWS webinar what is cloud computing 13 09 11
AWS webinar what is cloud computing 13 09 11
 
10 Pro Tips for Scaling Your Startup from 0-10M Users
10 Pro Tips for Scaling Your Startup from 0-10M Users10 Pro Tips for Scaling Your Startup from 0-10M Users
10 Pro Tips for Scaling Your Startup from 0-10M Users
 
AWS Cloud Essentials - An Overview
AWS Cloud Essentials - An OverviewAWS Cloud Essentials - An Overview
AWS Cloud Essentials - An Overview
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Aws what is cloud computing deck 08 14 13
Aws what is cloud computing deck 08 14 13Aws what is cloud computing deck 08 14 13
Aws what is cloud computing deck 08 14 13
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Cloud1 Computing 01
Cloud1 Computing 01Cloud1 Computing 01
Cloud1 Computing 01
 
Amazon Webservices Introduction And Core Modules
Amazon Webservices Introduction And Core Modules Amazon Webservices Introduction And Core Modules
Amazon Webservices Introduction And Core Modules
 
Managing Your Private Cloud with RightScale
Managing Your Private Cloud with RightScaleManaging Your Private Cloud with RightScale
Managing Your Private Cloud with RightScale
 
Cloud On-Ramp Project Briefing
Cloud On-Ramp Project BriefingCloud On-Ramp Project Briefing
Cloud On-Ramp Project Briefing
 
AWS Enterprise Day | Running Critical Business Applications on AWS
AWS Enterprise Day | Running Critical Business Applications on AWSAWS Enterprise Day | Running Critical Business Applications on AWS
AWS Enterprise Day | Running Critical Business Applications on AWS
 
What is Cloud Computing with AWS?
What is Cloud Computing with AWS?What is Cloud Computing with AWS?
What is Cloud Computing with AWS?
 
Gogrid
GogridGogrid
Gogrid
 
December 15 — Cloud Computing and Hosting
December 15 — Cloud Computing and HostingDecember 15 — Cloud Computing and Hosting
December 15 — Cloud Computing and Hosting
 
Cloud Economics: The Financial Case for Cloud Migration
Cloud Economics: The Financial Case for Cloud MigrationCloud Economics: The Financial Case for Cloud Migration
Cloud Economics: The Financial Case for Cloud Migration
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Caching inside serverless applications

  • 2. CLIENT NAME // PRESENTATION NAME // © COPYRIGHT 2020 ENDAVA // CONFIDENTIAL AND PROPRIETARY // VERSION 1.0 Radu Vunvulea Endava Microsoft Azure MPV Microsoft Regional Director 2010: 1st cloud commercial cloud project
  • 3. In an O'Reilly survey of 1500 IT professionals in 2019, 40% of respondents worked at organizations that have adopted serverless architecture A 2020 DataDog survey indicated that over 50% of AWS users are now using the serverless AWS Lambda Function as a Service (FaaS) https://www.infoq.com/news/2020/07/future -serverless-architecture/
  • 4. Why serverless? Faster time to market Cost efficiency Inherent scalability and resilience
  • 5. Serverless solution Write less code Event driven Less infrastructure
  • 6. C#, Java, JavaScript, PowerShell, or Python Custom Handler (e.g. Go, Rust) Docker Consumption Plan, Premium and App Services Kubernetes - KEDA Automate deployment
  • 7. Timeout 5’-30’ Max timeout 10’- oo’* *guaranteed up to 60’ Request size 100MB Query length 4096 Max memory 1.5-14GB (shared at Function App level) GB-s =(number of executions) x (execution duration in seconds) x (amount of RAM used in GB)
  • 8. Binding shared data Trigger event + data connect to another resources how a function is invoked
  • 9. Bindings Blob storage Azure Cosmos DB Dapr3 Event Grid Event Hubs HTTP & webhooks IoT Hub Kafka2 Mobile Apps Notification Hubs Queue storage RabbitMQ2 SendGrid Service Bus SignalR Table storage Timer Twilio Triggers
  • 10. Demo External resources / caching FStorage
  • 11. Stateless Stateful No state or locks between requests Persist state or locks between requests
  • 12. Stateful functions in serverless environment Behind the scene an extension that manage state, checkpoints and restarts (1) Orchestrator functions (2) Stateful entities Entities functions Durable
  • 14. Collects temporary data Reduce load or response time Content refresh Optimize bandwidth Cache
  • 16. In memory caching using static dictionary Simple to use for static content Error prone for refreshed content Impact Consumption Plan: value refreshed because of running time Elastic Premium Plan: pre-warmed with old value, new scaled instances with refreshed value App Service Plan: Similar with Elastic, but with more control Cache
  • 18. Memory Cache Capability to specify expiration time Refreshed content time can be managed Risk to get the old value still exist but it is smaller Impact Consumption Plan: value refreshed because of running time Elastic Premium Plan: pre-warmed with old value, new scaled instances with refreshed value App Service Plan: Similar with Elastic, but with more control Cache
  • 20. Azure Redis Cache Full control on content Ability to manage expiration and consistency Cache Easy to scale and manage
  • 21. Azure Redis Cache During high load you can get Time-out exceptions Causes Plan exceeded Object size vs single thread Synchronously access of large objects Noisy neighbors (C0 plan) Cache Error Explanation The Lazy instance is not thread safe; if the instance is accessed from multiple threads, its behavior is undefined. Use this mode only when high performance is crucial and the Lazy instance is guaranteed never to be initialized from more than one thread. If you use a Lazy constructor that specifies an initialization method (valueFactory parameter), and if that initialization method throws an exception (or fails to handle an exception) the first time you call the Value property, then the exception is cached and thrown again on subsequent calls to the Value property
  • 22.
  • 23.
  • 25. Dedicated solution (Azure Redis Cache) External Storage (Blob Storage, CosmosDB) Stateful (Durable Functions, Entity Functions) Cache In-memory (Static Dictionary, Memory Cache)
  • 26. What are you caching? DB queries external HTTP calls blob content configuration data
  • 27. Configuration Data Azure Table Azure Function In-memory cache LazyLoad
  • 28. Configuration Data Azure Table Azure Function In-memory cache Changeevent Event Grid LazyLoad Azure Function Clearcache Eventhandler EventPublisher EventSubscriptions
  • 29. Expensive Queries / API Calls 100B cache operations a day Query / API Azure Function Azure Redis Cache Azure Function Azure Function
  • 30. Expensive Queries / API Calls 100B cache operations a day Query / API Azure Function Azure Redis Cache Azure Function Azure Function Smalllatency (externalcall)
  • 31. Expensive API Calls API Azure Function API Management Azure Redis Cache
  • 32.