![Page 1: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/1.jpg)
Amazon ElastiCache for Redis: Backup and Restore
Dan Zamansky, Sr. Product Manager, AWS
![Page 2: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/2.jpg)
Agenda
• Overview of Caching
• ElastiCache for Redis
• Use Cases
• Design Patterns
• Backup and Restore
![Page 3: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/3.jpg)
Dimensions for categorizing data stores
• Persistence – In Memory vs Strongly Durable
• Data Model – Key Value vs Document Model vs Relational
• Scalability – None vs Scale up vs Scale out
![Page 4: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/4.jpg)
Redis is a popular key-value store
• High speed, in-memory, key-value data store
• Optional durability (persistence via snapshot or
append only file)
• Supports pub/sub functionality
![Page 5: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/5.jpg)
Redis is a popular key-value store
• Supports advanced data structures (in addition
to strings) – Lists of strings
– Sets of strings (collection of non-repeating unsorted elements)
– Sorted Sets (collections of non-repeating elements ordered by
a floating-point number called score)
– Hashes where keys and values are strings
![Page 6: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/6.jpg)
Elastic Load
Balancing EC2 App
Instances
MySQL DB
Instance
ElastiCache
for Redis
Database Writes
App
Reads
Clients
Cache
Updates
Use Redis to accelerate your application
Database Reads
![Page 7: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/7.jpg)
ElastiCache for Redis
• Managed Redis service
• Use existing clients
• Pay as you go
• Available in all public AWS regions since launch
![Page 8: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/8.jpg)
Benefits of a managed service
![Page 9: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/9.jpg)
Cost Effective Solution
On Demand Pricing RI Pricing (Heavy Utilization)
Instance
Type
EC2
Cost
ElastiCache
Cost
Difference EC2
Cost
ElastiCache
Cost
Difference
M1.large $126 $163 $37 $71 $92 $21
M2.xlarge $177 $217 $40 $69 $89 $20
Cost of running ElastiCache vs. a self-managed cache on EC2 (per month):
![Page 10: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/10.jpg)
Key features
• Compatibility with Redis engine
• Versions 2.6.13 and 2.8.6. supported
• Ability to create Redis nodes inside VPC
environment
• Support for Lua scripting
![Page 11: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/11.jpg)
Key Features
• Managed Redis experience – Console, API, and CLI options to create and manage Redis nodes
– Monitoring and node replacement
– CloudWatch metrics
– Support several instance types at launch: t1.micro, m1.small, m1.medium, m1.large, m1.XL, m2.XL, m2.2XL, m2.4XL, C1.XL
• Replication – Master-slave(s) configuration
• High Availability – Multi-AZ support
– Assisted failover: Console and API options to select best slave node for promotion to master during failover event
• Backup and DR – Ability to backup your Redis data through Backup and Restore
– Ability to seed an ElastiCache for Redis master node from both internal and external snapshots
![Page 12: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/12.jpg)
So just how fast is Redis?
• We created a test application that can work with or
without ElastiCache Redis in front of RDS database. – After adding ElastiCache, latency was cut by 8x and throughput jumped by 6x.
![Page 13: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/13.jpg)
Where is ElastiCache Redis used?
• Gaming
• Social
• Media & Entertainment
• Mobile
• Ad Tech
• Many more…
![Page 14: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/14.jpg)
• Auto-scaling front end
• Amazon ElastiCache
• Amazon RDS
• Amazon S3
• Amazon CloudFront
Sample deployment: Gaming
ZADD leaderboard 556 “Andy” ZADD leaderboard 819 “Barry” ZADD leaderboard 105 “Carl” ZADD leaderboard 1312 “Derek”
ZREVRANGE leaderboard 0 -1 1) “Derek” 2) “Barry” 3) “Andy” 4) “Carl”
![Page 15: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/15.jpg)
Design Patterns
• Cache
• Leaderboards
• High Speed Sorting
• Atomic Counters
• Queuing Systems
• Activity Streams
![Page 16: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/16.jpg)
Some things to watch out for with Redis
• Whole dataset must fit in memory
• Soft Persistence
• Single Threaded
• Some datatypes cannot scale out
• No Transactions
![Page 17: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/17.jpg)
Redis Data Protection and Persistence
Replication
• Master-Slave configuration
• Asynchronous (few seconds lag)
• Assisted Failover
AOF
• Logs writes received by server, thus can be used to reconstruct the dataset.
• A parameter that can be turned on and off easily
Backup
• Cluster-level snapshot
• Can be used for seeding Redis clusters
• Provides scaling up/down capability
![Page 18: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/18.jpg)
Redis Backup and Restore
• Create snapshots of Redis clusters via few clicks on the
console
• Create automatic or manual snapshots
• Use snapshots for data persistence, archiving and scaling – Can pre-seed larger or smaller sizes of Redis clusters, delivering scaling up/down
capability
![Page 19: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/19.jpg)
Backup and Restore - Best Practices
• Backup the slaves, not the master
• As a rule of thumb, filling less than 50% of the cluster
should ensure no swap.
– Use “reserved-memory” parameter to mitigate swap
• Backup and Restore isn’t supported on t1.micro
• Set backup window for a low utilization period (especially
low on writes)
![Page 20: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/20.jpg)
Setup Instructions: ElastiCache for Redis Cluster
![Page 21: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/21.jpg)
Setup Instructions: ElastiCache for Redis Cluster
![Page 22: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/22.jpg)
Setup Instructions: ElastiCache for Redis Cluster
![Page 23: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/23.jpg)
Setup Instructions: ElastiCache for Redis Cluster
![Page 24: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/24.jpg)
Setup instructions: Backup and Restore
![Page 25: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/25.jpg)
Setup instructions: Backup and Restore
![Page 26: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/26.jpg)
Free tier: 750 hours of Micro Cache Node per Month
Pay as little as $0.022 per hour thereafter
for a T1.micro node
We just made a 30% price drop in April, making
ElastiCache even more affordable.
You can get started for free
![Page 27: AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best Practices](https://reader034.vdocuments.site/reader034/viewer/2022042615/55d50fcebb61eb632e8b45b0/html5/thumbnails/27.jpg)
Amazon
ElastiCache for
Redis
Quick Review:
• Managed Redis service
• Easy migration
• Rich Use Cases
• Backup and Restore
For More Information:
• ElastiCache for Redis Detail Page and Docs:
http://aws.amazon.com/documentation/elasticache/
• Getting Started:
http://docs.aws.amazon.com/AmazonElastiCache/latest/U
serGuide/GettingStarted.html
Any Questions?