SlideShare a Scribd company logo
High-Availability: cache and queue 
2014-07-24 
Truc Le - afterlastangel@gmail.com
Executive Summary 
• The objective of this presentation is fundamental web 
development method using the cache. 
• Optimization code to reduce resource cost and make 
website faster. 
• Amazon Web Services for Cache and Queue 
2014-07-24 High-Availability: cache and queue
Outline 
• Cache 
• Simple example & Benchmark 
• Queue & Write behind 
• Simple worker demo 
• Amazon Web Services for Cache and Queue 
• Scalability 
2014-07-24 High-Availability: cache and queue
Caching 
• Cache can help reduce database loads. 
• Instead of going to the database, data can be loaded from 
in-memory cache 
• Times faster than database. 
2014-07-24 High-Availability: cache and queue
Simple implementation 
No cache 
2014-07-24 High-Availability: cache and queue
Get cache 
2014-07-24 High-Availability: cache and queue
Use & Set cache 
Expired time 60 seconds 
Serialize and & Unserialize for object storage 
2014-07-24 High-Availability: cache and queue
Benchmark method 
Tool : siege 
API URL : 20 
Deployment on AWS 
EC2 (ubuntu) : t2.micro 
RDS (mysql) : db.t1.micro 
ElasticCache (redis) : cache.t1.micro 
2014-07-24 High-Availability: cache and queue
Result 
Concurrent User: 50 - Delay: 10 - Repeat: 2 
Cache vs (No cache) 
Elapsed time : 20.13 secs ( 27.97) 
Response time : 0.93 secs ( 4.23 ) 
Transaction rate : 4.97 trans/sec ( 3.58 ) 
2014-07-24 High-Availability: cache and queue
Result 
Concurrent User: 100 - Delay: 10 - Repeat: 2 
Cache vs (No cache) 
Elapsed time : 30.97 secs ( 27.10) ??? 
Response time : 5 secs ( 3.84 ) ??? 
Transaction rate : 6.46 trans/sec ( 7.38 ) ??? 
2014-07-24 High-Availability: cache and queue
Log details 
2014-07-24 High-Availability: cache and queue 
96 empty 
responses
Conclusion 
- Too many connections (>32) 
- To increase max connections need larger RDS 
Cache helps: 
● Save money 
● More concurrent user 
● Faster delivery 
2014-07-24 High-Availability: cache and queue
What could be cached? 
• Database query 
• Variable & Object 
• View page & Template 
• API 
2014-07-24 High-Availability: cache and queue
Redis is more than cache 
• It's a "NoSQL" key-value data stores 
• It's a data structures server 
Applications: Counting stuff, Pub/Sub, Queues, Real time 
analysis, Leaderboards and related problems ... 
2014-07-24 High-Availability: cache and queue
Queue & Write-Behind 
● Offload database writes 
● Spread writes out to flatten peaks 
● Consolidate multiple writes into fewer database writes 
● Being disconnected from the DB will let the frontend keep 
running if the DB is down! 
2014-07-24 High-Availability: cache and queue
Architecture 
2014-07-24 High-Availability: cache and queue
Compare with traditional 
2014-07-24 High-Availability: cache and queue
Running demo queue 
2014-07-24 High-Availability: cache and queue
Amazon ElasticCache 
• Saves administrative cost 
• Provides replication features for the Redis engine 
• Automatically detects and replaces failed nodes 
• Availability Zone redundancy 
2014-07-24 High-Availability: cache and queue
2014-07-24 High-Availability: cache and queue
Amazon Simple Queue Service 
• Runs within Amazon’s high-availability data centers 
• All messages are stored redundantly across multiple 
servers and data centers 
• Unlimited number of services to read and write 
• Unlimited number of messages at any time 
• Inexpensive 
2014-07-24 High-Availability: cache and queue
Scalability 
2014-07-24 High-Availability: cache and queue

More Related Content

PDF
Володимир Цап "Constraint driven infrastructure - scale or tune?"
PDF
Роман Новиков "Best Practices for MySQL Performance & Troubleshooting with th...
PDF
Дмитро Волошин "High[Page]load"
PPT
Configuring Apache Servers for Better Web Perormance
PPTX
Cassandra Community Webinar: CMB - An Open Message Bus for the Cloud
PPTX
Webinar: Building Blocks for the Future of Television
PPTX
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
PDF
HIgh Performance Redis- Tague Griffith, GoPro
Володимир Цап "Constraint driven infrastructure - scale or tune?"
Роман Новиков "Best Practices for MySQL Performance & Troubleshooting with th...
Дмитро Волошин "High[Page]load"
Configuring Apache Servers for Better Web Perormance
Cassandra Community Webinar: CMB - An Open Message Bus for the Cloud
Webinar: Building Blocks for the Future of Television
GDG Ternopil TechTalks Web #1 2015 - Data storages in Microsoft Azure
HIgh Performance Redis- Tague Griffith, GoPro

What's hot (20)

PDF
Kafka Summit SF 2017 - Infrastructure for Streaming Applications
PDF
“Kick-off with Scale in Mind” by Yousef Wadi
PDF
Redis for horizontally scaled data processing at jFrog bintray
PPTX
Learn WordPress - Live Session 2 Slides
PDF
Using Redis at Facebook
PPTX
Redis Developers Day 2014 - Redis Labs Talks
PPTX
HBaseCon 2015 General Session: Zen - A Graph Data Model on HBase
PPT
World Wide Web Caching
PPTX
Redis Labs and SQL Server
PDF
Roshan Bhattarai: Scaling WordPress for high traffic sites
PPTX
Scaling wordpress for high traffic
PDF
Migratory Workloads Across Clouds with Nomad
PPTX
Kenshoo - Use Hadoop, One Week, No Coding
PPTX
Scylla Summit 2022: New AWS Instances Perfect for ScyllaDB
PPTX
Understanding Web Cache
PPTX
What to consider when monitoring microservices
PPTX
Using flash on the server side
PPTX
RedisConf17 - Home Depot - Turbo charging existing applications with Redis
PDF
Caching on the web
PDF
Hashicorp Nomad
Kafka Summit SF 2017 - Infrastructure for Streaming Applications
“Kick-off with Scale in Mind” by Yousef Wadi
Redis for horizontally scaled data processing at jFrog bintray
Learn WordPress - Live Session 2 Slides
Using Redis at Facebook
Redis Developers Day 2014 - Redis Labs Talks
HBaseCon 2015 General Session: Zen - A Graph Data Model on HBase
World Wide Web Caching
Redis Labs and SQL Server
Roshan Bhattarai: Scaling WordPress for high traffic sites
Scaling wordpress for high traffic
Migratory Workloads Across Clouds with Nomad
Kenshoo - Use Hadoop, One Week, No Coding
Scylla Summit 2022: New AWS Instances Perfect for ScyllaDB
Understanding Web Cache
What to consider when monitoring microservices
Using flash on the server side
RedisConf17 - Home Depot - Turbo charging existing applications with Redis
Caching on the web
Hashicorp Nomad
Ad

Similar to High availability system cache and queue - Write behind (20)

PPTX
Cloud - High Availability @ Low Cost - Workshop - Gurpreet ahuja
PPT
Speeding Up The Snail
PDF
SPSUtah 2014 SharePoint 2013 Performance (Admin)
PDF
Couchbase Singapore Meetup #2: Why Developing with Couchbase is easy !!
PPTX
Sql Start! 2020 - SQL Server Lift & Shift su Azure
PDF
Couchbase Chennai Meetup: Developing with Couchbase- made easy
PPTX
SQL Server Lift & Shift on Azure - SQL Saturday 921
PPTX
Building Scalable Applications with Microsoft Azure
KEY
Introduction to memcached
PDF
High-Performance Big Data Analytics with RDMA over NVM and NVMe-SSD
PPTX
Choosing right data store & processing
PPTX
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
PPTX
RapidScale CloudServer
PPTX
More Cache for Less Cash (DevLink 2014)
PDF
What's New in Apache Hive 3.0?
PDF
What's New in Apache Hive 3.0 - Tokyo
PPTX
More Cache for Less Cash
PDF
Scalability designprinciples-v2-130718023602-phpapp02 (1)
PDF
Scalability Design Principles - Internal Session
PDF
Serverless: A love hate relationship
Cloud - High Availability @ Low Cost - Workshop - Gurpreet ahuja
Speeding Up The Snail
SPSUtah 2014 SharePoint 2013 Performance (Admin)
Couchbase Singapore Meetup #2: Why Developing with Couchbase is easy !!
Sql Start! 2020 - SQL Server Lift & Shift su Azure
Couchbase Chennai Meetup: Developing with Couchbase- made easy
SQL Server Lift & Shift on Azure - SQL Saturday 921
Building Scalable Applications with Microsoft Azure
Introduction to memcached
High-Performance Big Data Analytics with RDMA over NVM and NVMe-SSD
Choosing right data store & processing
Best Practices for Administering Hadoop with Hortonworks Data Platform (HDP) ...
RapidScale CloudServer
More Cache for Less Cash (DevLink 2014)
What's New in Apache Hive 3.0?
What's New in Apache Hive 3.0 - Tokyo
More Cache for Less Cash
Scalability designprinciples-v2-130718023602-phpapp02 (1)
Scalability Design Principles - Internal Session
Serverless: A love hate relationship
Ad

More from Le Kien Truc (9)

PDF
Question and Answer - ubuntu-vn - Idea
PPT
Webanalytics with haddop and Hive
PDF
Piwik analytics introduction at Fossasia2014
DOCX
Realtime system with pushpin fanout, controlling your devices
DOCX
Aws cloud infrastructure and cost estimation for angular site
DOCX
Wordpress site scaling architecture on cloud infrastructure with AWS
PPTX
Large scale web socket system with AWS and Web socket
PDF
Interactive image discovery
PDF
FPT University - Capstone project - Using QR Code to prevent fake products
Question and Answer - ubuntu-vn - Idea
Webanalytics with haddop and Hive
Piwik analytics introduction at Fossasia2014
Realtime system with pushpin fanout, controlling your devices
Aws cloud infrastructure and cost estimation for angular site
Wordpress site scaling architecture on cloud infrastructure with AWS
Large scale web socket system with AWS and Web socket
Interactive image discovery
FPT University - Capstone project - Using QR Code to prevent fake products

Recently uploaded (20)

PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
L1 - Introduction to python Backend.pptx
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Cost to Outsource Software Development in 2025
PPTX
assetexplorer- product-overview - presentation
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Nekopoi APK 2025 free lastest update
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Monitoring Stack: Grafana, Loki & Promtail
17 Powerful Integrations Your Next-Gen MLM Software Needs
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
CHAPTER 2 - PM Management and IT Context
L1 - Introduction to python Backend.pptx
Complete Guide to Website Development in Malaysia for SMEs
Cost to Outsource Software Development in 2025
assetexplorer- product-overview - presentation
Oracle Fusion HCM Cloud Demo for Beginners
Operating system designcfffgfgggggggvggggggggg
Nekopoi APK 2025 free lastest update
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Advanced SystemCare Ultimate Crack + Portable (2025)
Navsoft: AI-Powered Business Solutions & Custom Software Development

High availability system cache and queue - Write behind

  • 1. High-Availability: cache and queue 2014-07-24 Truc Le - afterlastangel@gmail.com
  • 2. Executive Summary • The objective of this presentation is fundamental web development method using the cache. • Optimization code to reduce resource cost and make website faster. • Amazon Web Services for Cache and Queue 2014-07-24 High-Availability: cache and queue
  • 3. Outline • Cache • Simple example & Benchmark • Queue & Write behind • Simple worker demo • Amazon Web Services for Cache and Queue • Scalability 2014-07-24 High-Availability: cache and queue
  • 4. Caching • Cache can help reduce database loads. • Instead of going to the database, data can be loaded from in-memory cache • Times faster than database. 2014-07-24 High-Availability: cache and queue
  • 5. Simple implementation No cache 2014-07-24 High-Availability: cache and queue
  • 6. Get cache 2014-07-24 High-Availability: cache and queue
  • 7. Use & Set cache Expired time 60 seconds Serialize and & Unserialize for object storage 2014-07-24 High-Availability: cache and queue
  • 8. Benchmark method Tool : siege API URL : 20 Deployment on AWS EC2 (ubuntu) : t2.micro RDS (mysql) : db.t1.micro ElasticCache (redis) : cache.t1.micro 2014-07-24 High-Availability: cache and queue
  • 9. Result Concurrent User: 50 - Delay: 10 - Repeat: 2 Cache vs (No cache) Elapsed time : 20.13 secs ( 27.97) Response time : 0.93 secs ( 4.23 ) Transaction rate : 4.97 trans/sec ( 3.58 ) 2014-07-24 High-Availability: cache and queue
  • 10. Result Concurrent User: 100 - Delay: 10 - Repeat: 2 Cache vs (No cache) Elapsed time : 30.97 secs ( 27.10) ??? Response time : 5 secs ( 3.84 ) ??? Transaction rate : 6.46 trans/sec ( 7.38 ) ??? 2014-07-24 High-Availability: cache and queue
  • 11. Log details 2014-07-24 High-Availability: cache and queue 96 empty responses
  • 12. Conclusion - Too many connections (>32) - To increase max connections need larger RDS Cache helps: ● Save money ● More concurrent user ● Faster delivery 2014-07-24 High-Availability: cache and queue
  • 13. What could be cached? • Database query • Variable & Object • View page & Template • API 2014-07-24 High-Availability: cache and queue
  • 14. Redis is more than cache • It's a "NoSQL" key-value data stores • It's a data structures server Applications: Counting stuff, Pub/Sub, Queues, Real time analysis, Leaderboards and related problems ... 2014-07-24 High-Availability: cache and queue
  • 15. Queue & Write-Behind ● Offload database writes ● Spread writes out to flatten peaks ● Consolidate multiple writes into fewer database writes ● Being disconnected from the DB will let the frontend keep running if the DB is down! 2014-07-24 High-Availability: cache and queue
  • 17. Compare with traditional 2014-07-24 High-Availability: cache and queue
  • 18. Running demo queue 2014-07-24 High-Availability: cache and queue
  • 19. Amazon ElasticCache • Saves administrative cost • Provides replication features for the Redis engine • Automatically detects and replaces failed nodes • Availability Zone redundancy 2014-07-24 High-Availability: cache and queue
  • 21. Amazon Simple Queue Service • Runs within Amazon’s high-availability data centers • All messages are stored redundantly across multiple servers and data centers • Unlimited number of services to read and write • Unlimited number of messages at any time • Inexpensive 2014-07-24 High-Availability: cache and queue