SlideShare a Scribd company logo
1 of 44
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hands-on Amazon ElastiCache for Redis
Michael Labib
AWS Principal Solutions
Architect
D A T 3 0 9
John Husemoller
AWS Solutions Architect
Matt Wolff
AWS Solutions Architect
John Marciniak
AWS Solutions Architect
David Rodriguez
AWS Solutions Architect
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
 What’s New
 Amazon ElastiCache for Redis Overview
 Lab Time
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data categories and common use cases
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift,
CRM, finance
Key-value
Low-latency,
key lookups
with high
throughput and
fast ingestion
of data
Real-time bidding,
shopping cart,
social, product
catalog, customer
preferences
Document
Indexing and
storing
documents
with support
for query on
any attribute
Content
management,
personalization,
mobile
In-memory
Microseconds
latency, key-
based queries,
and specialized
data structures
Leaderboards,
real-time analytics,
caching
Graph
Creating and
navigating
relationships
between data
easily and
quickly
Fraud detection,
social networking,
recommendation
engine
Can you think of an application that
can’t benefit from ?speed
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What’s New: Redis & Memcached
• Redis Streams
• SortedSets now have LIST capabilities (POP and BLOCK)
• HyperLogLogs has an optimized algorithm
• Speed Improvements (Jemalloc additions, etc.)
• Active Defragmentation
• Added In-line HELP command for redis-cli
• Native TLS Integration Redis (ElastiCache)
• More at https://aws.amazon.com/re dis/Whats_ Ne w_Re dis5
• Automated Slab rebalancing
• LRU crawler to background-reclaim memory
• Faster hash table lookups with murmur3 algorithm
 Redis 5.0
 Memcached 1.5.10
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Review: Time Series in Redis before Redis 5
SortedSet - Use the Unix time as a score
• Values (messages) have to be unique
• Scores can be modified (are mutable)
Key
value: mike
score: 50 score: 75
value: dan value: emma
score: 79
value: lina
score: 123
value: luke
score: 350
Key HEAD value 1 value 2 value 3 TAIL
List - (blocking queue)
• No message recovery or fanout capabilities
Pub/Sub
• No persistence
• No recovery from failed clients
Channel SubscriberPublisher
Subscriber
Subscriber
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New: Redis 5 (Redis Streams)
Hello!
Producer
XADD mystream * msg
Stream
XRANGE mystream - +
1) 1) "1542737709872-0"
2) 1) "msg"
2) "hello!“
Consumer
Generate a unique ID = time - sequence
Log data structure for time series
Append only data structure with ability to fan
out
Add messages to a stream Single Consumer
Listen to items : XREAD
Query by range: XRANGE, XREVRANGE
Items in the stream: XLEN
at least once messaging
"154273770872-0"
Redis generated unique ID
Consumer Groups (X G R O U P , X R E A D G R O U P )
Allow multiple consumers to participate in processing messages
by each consuming a unique subset of the data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New: Amazon ElastiCache: In-Place Version Upgrades
• Upgrade a Redis Cluster to newer engine version in-place
• No Manual Steps or Application Changes
• Available for ElastiCache for Redis Version 3.2 and Higher
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New: Amazon ElastiCache Optimized Instances M5 | R5
• Scale up to 9.5 TiB of in-
memory capacity
• AWS Nitro System,
dedicated hardware &
lightweight hypervisor,
delivers performance
indistinguishable from
bare metal
• Custom Intel Xeon
Scalable processors up to
3.1 GHz & AVX-512
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
When 9.5 TiB is not enough!
Example 1:
• Assume 125 shards made of 1 Primary + 1 Replica = 250 nodes
• Assume R5.24xlarge ( 635.61 GiB )
• Cluster memory 635.61 GiB X 125 = ~80 TiB = ~88 TB
Example 2:
• Assume 250 shards made of 1 Primary + 0 Replica = 250 nodes
• Assume R5.24xlarge ( 635.61 GiB )
• Cluster memory 635.61 GiB X 250 = ~159 TiB = ~170 TB
New: Amazon ElastiCache 250 node support
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Coming soon….
PERFORMANCE BOOST FOR MULTI-CORE NODES
Further optimizations providing significant throughput boost
RENAME COMMAND SUPPORT
Ability to rename a command
SELF-SERVICE PATCHING
Provides increased flexibility to control when updates occur
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis Overview
Fast
<1ms latency for most commands
Open source
Easy to learn
Highly available
Replication
Atomic operations
Supports transactions
In-memory
key-value store
Powerful
~200 commands, Lua scripting,
Geospatial, Pub/Sub
Various data structures
Strings, lists, hashes, sets,
sorted sets, bitmaps, streams,
and HyperLogLogs
Persistence
Snapshots
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Difficult to ScaleDifficult to
Manage
Hard to make
Highly
Available
Self-Managing Redis is Challenging
Expensive
Online scaling can be
error prone. Replication
performance needs to
be monitored
Manage hardware
provisioning, software
patching, setup,
configuration, and
backups
Redis outage impacts
application performance
Invest in people, processes,
hardware, and software
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Introducing Amazon ElastiCache for Redis
Fully-managed, Redis compatible, in-memory data store in the cloud
Extreme Performance
In-memory data store and
cache for sub-millisecond
response times
Fully Managed
AWS manages all hardware
and software setup,
configuration, monitoring
Easily Scalable
Read scaling with replicas
Write and memory
scaling with sharding
Non disruptive scaling
Redis Compatible
Redis 5 Support
Redis clients compatible
Reliable
Multi-AZ
Deep monitoring
Automatic failover
Secure & Compliant
Amazon VPC
HIPAA, PCI, FedRAMP
Encryption at-rest and in-transit
Authentication
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis Use Cases
Gaming
leaderboards
Chat apps
Caching
Session
store
Machine learning
Real-time
analytics
Media
streaming
Geospatial
Message queues
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPC
Public subnet
Availability zone 1
Public subnet
Availability zone 2
Auto Scaling group
Private subnet Private subnet
Cache node Cache node
Redis Cluster-mode disabled (Vertically Scale)
Primary Endpoint Replica Endpoints
All keys on
same node
Keyspace
Connect to Primary for
Read/Writes and Replica’s
for Reads
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPC
Public subnet
Availability zone 1
Public subnet
Availability zone 2
Auto Scaling group
Private subnet Private subnet
Cache node
Redis Cluster (Horizontally Scaled)
Zero Downtime Scaling
Configuration
Endpoint
Cache node Cache nodeCache node
Shard 1 Slot 0 - …
Shard 2 Slot … to …
Keyspace
Shard 3 Slot … to …
Shard 4 Slot … to 16383
Partitioned by Shard
Cluster Map
Clients use hash value for
a key CRC16(key) mod
16384
Distribution
Equal | Custom
( CW Metric: CurrItems )
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Feature Enabled Disabled
Configuration Data is partitioned across shards (up to 15)
Each shard has 1 primary and up to 5 replicas
Data resides in one primary
May have up to 5 replicas
Redis Compliant Fully compliant with Open Source Redis Cluster APIs
and client ecosystem
Fully compliant with Open Source Redis
Classic APIs and client ecosystem
Cluster Size 90 nodes—15 primaries + 0–5 replicas per shard 6 nodes (1 primary + 0–5 replicas)
Scalability and Performance • Throughput scales with number of shards
• In-memory capacity up to 9.5 TiB
• Throughput limited by 1 primary, 5
replicas
• In-memory capacity up to 635 GiB
Max connections • Primaries (65,000 x 15 = 975,000)*
• Replicas (65,000 x 75 = 4,875,000)
• Primary: 65,000
• Replicas: (65,000 x 5 = 325,000)
Redis Cluster mode enabled vs disabled
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Feature Enabled Disabled
Scaling Operation Online Cluster Resizing
• Horizontal Scaling to add/remove shards
• Read Scalability to add/remove replicas
Vertical Scaling
• Writes are blocked
• Reads not supported on master node
Failover 15–30 sec (Non-DNS) 30-45 sec + additional DNS propagation
Failover risk • Writes affected on partial dataset
• Reads available
• Writes affected on entire dataset
• Reads available
Cost
Example: Assume workload
needs 140 GB
Similar (Many Smaller nodes)
15 x cache.r4.large ($0.228hr) = $3.42 hour 184.5 GB
Similar (Few larger nodes)
1 X cache.r4.8xlarge = $3.64 hr , 203.26 GB
Redis Cluster mode enabled vs disabled
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cluster-mode enabled failover
Cache node
Primary Replica
Shard
x5
x15
Cache node
async replication
CW Metric: ReplicationLag
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cache node
Primary Replica
Shard
Cache node
async replication
Cluster-mode enabled failover
Failover Detection
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cache node
Primary Replica
Shard
Cache node
async replication
Cluster-mode enabled failover
Automatic Failover
(with no DNS propagation)
Test with Failover API
SNS Event: ElastiCache:CacheNodeReplaceComplete
SNS Event: ElastiCache:FailoverComplete
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
0-5461
reads/ writes
Shard 1 Shard 2 Shard 3
Shard 4 Shard 5
5462--10922 10923-163830-2909,
5095-5461
5462-5783,
6876-9830
10923-14199
2910-5094,
9831--10922
No Application Interruption
Uniform slot distribution across shards
5784-6875,
14200-16383
Zero downtime - Online re-sharding - scale out
Cache node Cache node Cache node
Cache nodeCache node
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
0-5461
reads/ writes
Shard 1 Shard 2 Shard 3
Shard 4 Shard 5
5462--10922 10923-16383
Uniform slot distribution across shards
Cache node Cache node Cache node
Cache nodeCache node
No Application Interruption
Zero downtime - Online re-sharding - scale in
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Online re-sharding— CW alarm trigger
…
var params = {
ApplyImmediately: true,
NodeGroupCount: 5,
ReplicationGroupId: ‘rep-group-id’,
… }
elasticache.modifyReplicationGroupShardConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack);
else console.log(data);
}); …
Alarm
Lambda
Function
Topic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Caching
In-memory cache
relational
object
API Responses
connected data
non-relational
search
analytics
application
Cache it if
you can
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Real-time: Sentiment Analysis
Queue (List) ,
Redis Streams
Sentiment
Leaderboard
Sentiment
Data store
Ingestion Tools
Worker,
Consumer
Sentiment
Analysis
Ingest High Velocity
(Rank and Query)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Real-time: AWS IoT Core
Rule
Generic
Lambda
function
House Lightbulb Thermostat Utility
Devices
Redis Streams
Data Lake
Real-time
Store Time Series
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Filter Raw
Stream
Cleansed
Stream
Raw
Stream
Parse
Stream
(RAW)
Real-time: Amazon Kinesis Filtering
Lambda
function
Lambda
function
Parse
Stream
(Cleansed)
Stream
(Analytics)
RAW
Stream
(Analytics)
Decorate and Filter
Raw Data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Mobile
Lambda
Function
devices
authenticate
authorize
geo-based
queries
write-back,
geo add
APIs
primary
Data store
Geospatial and
Cached Data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Rate Limiting
Other Resources
APIs
Application
Rate Limiter
(Redis Counter)
Reduce backend
pressure
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Graph & Search Integration
Logstash (Redis Channels, List)
Buffered
data
Application
Search & Log AnalyticsConnected Data
https://github.com/logstash-plugins/logstash-input-redis
BLPOP
Compliment Graph:
Geospatial ,
Aggregation ,
Cache
Ingest High Velocity
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cluster sizing best practices
• Storage—Clusters should have adequate memory
• Recommended: Memory needed + 25% reserved memory (for Redis) + some room for growth (optional 10%)
• Optimize using eviction policies and TTLs
• Scale up or out when before reaching max-memory using CloudWatch alarms
• Use memory optimized nodes for cost effectiveness (R5 support )
• Performance—Performance should not be compromised
• Benchmark operations using Redis Benchmark tool
• For more READIOPS—Add replicas
• For more WRITEIOPS—Add shards (scale out)
• For more network IO—Use network optimized instances and scale out
• Use pipelining for bulk reads/writes
• Consider Big(O) time complexity for data structure commands
• Cluster Isolation (apps sharing key space)—Choose a strategy that works for your workload
• Identify what kind of isolation is needed based on the workload and environment
• Isolation: No Isolation $ | Isolation by Purpose $$ | Full Isolation $$$
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudWatch Monitoring
• Metric: BytesUsedForCache
• Resolution: scale up | out
• Metric: CacheHits / Metric: CacheMisses
• Aim for +80% Hits/Misses ratio
• Resolution: Optimize TTL & Cache Strategy
• Metric: CurrConnections
• Should be stable
• Resolution: Connection Pooling, Scale out
• Metric: EngineCPUUtilization
• Should not exceed 90% allocation,
• Resolution: Scale out
• Metric: Evictions > 1
• Resolution: scale up | out
• Metric: SwapUsage > few MBs
• Resolution: scale up | out
Lambda
Function
Alarm Topic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis max-memory policies
Select a max-memory policy based on your workload needs
• noeviction: return errors when the memory limit was reached and the client is trying to execute
commands that might result in more memory to be used.
• allkeys-lru: evict keys trying to remove the less recently used (LRU) keys first.
• volatile-lru: evict keys trying to remove the less recently used (LRU) keys first, but only among keys that
have an expire set.
• allkeys-random: evict random keys to make space for the new data added.
• volatile-random: evict random keys to make space for the new data added, but only evict keys with an
expire set.
• volatile-ttl: evict only keys with an expire set, and try to evict keys with a shorter time to live (TTL) first.
• volatile-lfu: evict least frequently used containing an expiration
• allkeys-lfu: evict any keys using least frequently used
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Q&A
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab Time
1. Login to your temp account: (You should have received your temporary account card)
2. Download the lab guide: http://bit.ly/reInventRedis
3. Make sure you are working in: US-EAST-2
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
https://aws.amazon.com/elasticache/
John Husemoller
@jdhusem
Matt Wolff
@matwolff
John Marciniak
@jomarcin
David Rodriguez
@rodzdavi
Michael Labib
@mlabib
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanAmazon Web Services
 
Disaster Recovery Options with AWS
Disaster Recovery Options with AWSDisaster Recovery Options with AWS
Disaster Recovery Options with AWSAmazon Web Services
 
AWS Webcast - Introduction to EBS
AWS Webcast - Introduction to EBS AWS Webcast - Introduction to EBS
AWS Webcast - Introduction to EBS Amazon Web Services
 
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...Simplilearn
 
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...Amazon Web Services
 
Intro to Amazon S3
Intro to Amazon S3Intro to Amazon S3
Intro to Amazon S3Yu Lun Teo
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech TalkAmazon Web Services
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019Amazon Web Services
 
AWS Monitoring & Logging
AWS Monitoring & LoggingAWS Monitoring & Logging
AWS Monitoring & LoggingJason Poley
 
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | EdurekaAmazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | EdurekaEdureka!
 
Azure App Service
Azure App ServiceAzure App Service
Azure App ServiceBizTalk360
 

What's hot (20)

AWS Simple Storage Service (s3)
AWS Simple Storage Service (s3) AWS Simple Storage Service (s3)
AWS Simple Storage Service (s3)
 
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
 
Disaster Recovery Options with AWS
Disaster Recovery Options with AWSDisaster Recovery Options with AWS
Disaster Recovery Options with AWS
 
Amazon Cognito Deep Dive
Amazon Cognito Deep DiveAmazon Cognito Deep Dive
Amazon Cognito Deep Dive
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
AWS Route53
AWS Route53AWS Route53
AWS Route53
 
AWS Webcast - Introduction to EBS
AWS Webcast - Introduction to EBS AWS Webcast - Introduction to EBS
AWS Webcast - Introduction to EBS
 
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
AWS S3 | Tutorial For Beginners | AWS S3 Bucket Tutorial | AWS Tutorial For B...
 
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Chicago ...
 
Aws VPC
Aws VPCAws VPC
Aws VPC
 
Intro to Amazon S3
Intro to Amazon S3Intro to Amazon S3
Intro to Amazon S3
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
 
ElastiCache & Redis
ElastiCache & RedisElastiCache & Redis
ElastiCache & Redis
 
Serverless architecture
Serverless architectureServerless architecture
Serverless architecture
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
 
AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019AWS Core Services Overview, Immersion Day Huntsville 2019
AWS Core Services Overview, Immersion Day Huntsville 2019
 
AWS Monitoring & Logging
AWS Monitoring & LoggingAWS Monitoring & Logging
AWS Monitoring & Logging
 
Aws EC2 ENI, ENA, EFA
Aws EC2 ENI, ENA, EFAAws EC2 ENI, ENA, EFA
Aws EC2 ENI, ENA, EFA
 
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | EdurekaAmazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
 
Azure App Service
Azure App ServiceAzure App Service
Azure App Service
 

Similar to Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:Invent 2018

ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...
ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...
ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...Amazon Web Services
 
Fast Data at Scale - AWS Summit Tel Aviv 2017
Fast Data at Scale - AWS Summit Tel Aviv 2017Fast Data at Scale - AWS Summit Tel Aviv 2017
Fast Data at Scale - AWS Summit Tel Aviv 2017Amazon Web Services
 
10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks
10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks
10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech TalksAmazon Web Services
 
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech TalksElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech TalksAmazon Web Services
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsRedis Labs
 
Amazon ElastiCache (Dan Zamansky) - AWS DB Day
Amazon ElastiCache (Dan Zamansky) - AWS DB DayAmazon ElastiCache (Dan Zamansky) - AWS DB Day
Amazon ElastiCache (Dan Zamansky) - AWS DB DayAmazon Web Services Korea
 
Intro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech TalksIntro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech TalksAmazon Web Services
 
Building High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataBuilding High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataAmazon Web Services
 
ElastiCache and Redis - Samir Karande
ElastiCache and Redis - Samir KarandeElastiCache and Redis - Samir Karande
ElastiCache and Redis - Samir KarandeAmazon Web Services
 
Real-time Analytics with Redis
Real-time Analytics with RedisReal-time Analytics with Redis
Real-time Analytics with RedisCihan Biyikoglu
 
Building low latency apps with a serverless architecture and in-memory data I...
Building low latency apps with a serverless architecture and in-memory data I...Building low latency apps with a serverless architecture and in-memory data I...
Building low latency apps with a serverless architecture and in-memory data I...AWS Germany
 
AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...
AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...
AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...Amazon Web Services
 
ElastiCache & Redis: Database Week San Francisco
ElastiCache & Redis: Database Week San FranciscoElastiCache & Redis: Database Week San Francisco
ElastiCache & Redis: Database Week San FranciscoAmazon Web Services
 
Real Time Data Processing Using AWS Lambda
Real Time Data Processing Using AWS LambdaReal Time Data Processing Using AWS Lambda
Real Time Data Processing Using AWS LambdaAmazon Web Services
 
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...Amazon Web Services
 
ElastiCache & Redis: Database Week SF
ElastiCache & Redis: Database Week SFElastiCache & Redis: Database Week SF
ElastiCache & Redis: Database Week SFAmazon Web Services
 
Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...
Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...
Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...Amazon Web Services
 

Similar to Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:Invent 2018 (20)

ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...
ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...
ElastiCache Deep Dive: Design Patterns for In-Memory Data Stores (DAT302-R1) ...
 
Managed NoSQL databases
Managed NoSQL databasesManaged NoSQL databases
Managed NoSQL databases
 
Fast Data at Scale - AWS Summit Tel Aviv 2017
Fast Data at Scale - AWS Summit Tel Aviv 2017Fast Data at Scale - AWS Summit Tel Aviv 2017
Fast Data at Scale - AWS Summit Tel Aviv 2017
 
10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks
10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks
10 Hacks for Optimizing MySQL in the Cloud - AWS Online Tech Talks
 
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech TalksElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
ElastiCache: Deep Dive Best Practices and Usage Patterns - AWS Online Tech Talks
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis Labs
 
Amazon ElastiCache (Dan Zamansky) - AWS DB Day
Amazon ElastiCache (Dan Zamansky) - AWS DB DayAmazon ElastiCache (Dan Zamansky) - AWS DB Day
Amazon ElastiCache (Dan Zamansky) - AWS DB Day
 
Intro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech TalksIntro to Open Source Databases on AWS - AWS Online Tech Talks
Intro to Open Source Databases on AWS - AWS Online Tech Talks
 
Building High Performance Apps with In-memory Data
Building High Performance Apps with In-memory DataBuilding High Performance Apps with In-memory Data
Building High Performance Apps with In-memory Data
 
ElastiCache and Redis - Samir Karande
ElastiCache and Redis - Samir KarandeElastiCache and Redis - Samir Karande
ElastiCache and Redis - Samir Karande
 
Real-time Analytics with Redis
Real-time Analytics with RedisReal-time Analytics with Redis
Real-time Analytics with Redis
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Building low latency apps with a serverless architecture and in-memory data I...
Building low latency apps with a serverless architecture and in-memory data I...Building low latency apps with a serverless architecture and in-memory data I...
Building low latency apps with a serverless architecture and in-memory data I...
 
AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...
AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...
AWS re:Invent 2016: ElastiCache Deep Dive: Best Practices and Usage Patterns ...
 
ElastiCache & Redis: Database Week San Francisco
ElastiCache & Redis: Database Week San FranciscoElastiCache & Redis: Database Week San Francisco
ElastiCache & Redis: Database Week San Francisco
 
Real Time Data Processing Using AWS Lambda
Real Time Data Processing Using AWS LambdaReal Time Data Processing Using AWS Lambda
Real Time Data Processing Using AWS Lambda
 
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
ElastiCache & Redis: Database Week SF
ElastiCache & Redis: Database Week SFElastiCache & Redis: Database Week SF
ElastiCache & Redis: Database Week SF
 
Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...
Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...
Building real-time applications with Amazon ElastiCache - ADB204 - Anaheim AW...
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Hands-On with Amazon ElastiCache for Redis - Workshop (DAT309-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands-on Amazon ElastiCache for Redis Michael Labib AWS Principal Solutions Architect D A T 3 0 9 John Husemoller AWS Solutions Architect Matt Wolff AWS Solutions Architect John Marciniak AWS Solutions Architect David Rodriguez AWS Solutions Architect
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda  What’s New  Amazon ElastiCache for Redis Overview  Lab Time
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Data categories and common use cases Relational Referential integrity, ACID transactions, schema- on-write Lift and shift, CRM, finance Key-value Low-latency, key lookups with high throughput and fast ingestion of data Real-time bidding, shopping cart, social, product catalog, customer preferences Document Indexing and storing documents with support for query on any attribute Content management, personalization, mobile In-memory Microseconds latency, key- based queries, and specialized data structures Leaderboards, real-time analytics, caching Graph Creating and navigating relationships between data easily and quickly Fraud detection, social networking, recommendation engine
  • 5. Can you think of an application that can’t benefit from ?speed
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What’s New: Redis & Memcached • Redis Streams • SortedSets now have LIST capabilities (POP and BLOCK) • HyperLogLogs has an optimized algorithm • Speed Improvements (Jemalloc additions, etc.) • Active Defragmentation • Added In-line HELP command for redis-cli • Native TLS Integration Redis (ElastiCache) • More at https://aws.amazon.com/re dis/Whats_ Ne w_Re dis5 • Automated Slab rebalancing • LRU crawler to background-reclaim memory • Faster hash table lookups with murmur3 algorithm  Redis 5.0  Memcached 1.5.10
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Review: Time Series in Redis before Redis 5 SortedSet - Use the Unix time as a score • Values (messages) have to be unique • Scores can be modified (are mutable) Key value: mike score: 50 score: 75 value: dan value: emma score: 79 value: lina score: 123 value: luke score: 350 Key HEAD value 1 value 2 value 3 TAIL List - (blocking queue) • No message recovery or fanout capabilities Pub/Sub • No persistence • No recovery from failed clients Channel SubscriberPublisher Subscriber Subscriber
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New: Redis 5 (Redis Streams) Hello! Producer XADD mystream * msg Stream XRANGE mystream - + 1) 1) "1542737709872-0" 2) 1) "msg" 2) "hello!“ Consumer Generate a unique ID = time - sequence Log data structure for time series Append only data structure with ability to fan out Add messages to a stream Single Consumer Listen to items : XREAD Query by range: XRANGE, XREVRANGE Items in the stream: XLEN at least once messaging "154273770872-0" Redis generated unique ID Consumer Groups (X G R O U P , X R E A D G R O U P ) Allow multiple consumers to participate in processing messages by each consuming a unique subset of the data
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New: Amazon ElastiCache: In-Place Version Upgrades • Upgrade a Redis Cluster to newer engine version in-place • No Manual Steps or Application Changes • Available for ElastiCache for Redis Version 3.2 and Higher
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New: Amazon ElastiCache Optimized Instances M5 | R5 • Scale up to 9.5 TiB of in- memory capacity • AWS Nitro System, dedicated hardware & lightweight hypervisor, delivers performance indistinguishable from bare metal • Custom Intel Xeon Scalable processors up to 3.1 GHz & AVX-512
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. When 9.5 TiB is not enough! Example 1: • Assume 125 shards made of 1 Primary + 1 Replica = 250 nodes • Assume R5.24xlarge ( 635.61 GiB ) • Cluster memory 635.61 GiB X 125 = ~80 TiB = ~88 TB Example 2: • Assume 250 shards made of 1 Primary + 0 Replica = 250 nodes • Assume R5.24xlarge ( 635.61 GiB ) • Cluster memory 635.61 GiB X 250 = ~159 TiB = ~170 TB New: Amazon ElastiCache 250 node support
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Coming soon…. PERFORMANCE BOOST FOR MULTI-CORE NODES Further optimizations providing significant throughput boost RENAME COMMAND SUPPORT Ability to rename a command SELF-SERVICE PATCHING Provides increased flexibility to control when updates occur
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Redis Overview Fast <1ms latency for most commands Open source Easy to learn Highly available Replication Atomic operations Supports transactions In-memory key-value store Powerful ~200 commands, Lua scripting, Geospatial, Pub/Sub Various data structures Strings, lists, hashes, sets, sorted sets, bitmaps, streams, and HyperLogLogs Persistence Snapshots
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Difficult to ScaleDifficult to Manage Hard to make Highly Available Self-Managing Redis is Challenging Expensive Online scaling can be error prone. Replication performance needs to be monitored Manage hardware provisioning, software patching, setup, configuration, and backups Redis outage impacts application performance Invest in people, processes, hardware, and software
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Introducing Amazon ElastiCache for Redis Fully-managed, Redis compatible, in-memory data store in the cloud Extreme Performance In-memory data store and cache for sub-millisecond response times Fully Managed AWS manages all hardware and software setup, configuration, monitoring Easily Scalable Read scaling with replicas Write and memory scaling with sharding Non disruptive scaling Redis Compatible Redis 5 Support Redis clients compatible Reliable Multi-AZ Deep monitoring Automatic failover Secure & Compliant Amazon VPC HIPAA, PCI, FedRAMP Encryption at-rest and in-transit Authentication
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Redis Use Cases Gaming leaderboards Chat apps Caching Session store Machine learning Real-time analytics Media streaming Geospatial Message queues
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPC Public subnet Availability zone 1 Public subnet Availability zone 2 Auto Scaling group Private subnet Private subnet Cache node Cache node Redis Cluster-mode disabled (Vertically Scale) Primary Endpoint Replica Endpoints All keys on same node Keyspace Connect to Primary for Read/Writes and Replica’s for Reads
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPC Public subnet Availability zone 1 Public subnet Availability zone 2 Auto Scaling group Private subnet Private subnet Cache node Redis Cluster (Horizontally Scaled) Zero Downtime Scaling Configuration Endpoint Cache node Cache nodeCache node Shard 1 Slot 0 - … Shard 2 Slot … to … Keyspace Shard 3 Slot … to … Shard 4 Slot … to 16383 Partitioned by Shard Cluster Map Clients use hash value for a key CRC16(key) mod 16384 Distribution Equal | Custom ( CW Metric: CurrItems )
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Feature Enabled Disabled Configuration Data is partitioned across shards (up to 15) Each shard has 1 primary and up to 5 replicas Data resides in one primary May have up to 5 replicas Redis Compliant Fully compliant with Open Source Redis Cluster APIs and client ecosystem Fully compliant with Open Source Redis Classic APIs and client ecosystem Cluster Size 90 nodes—15 primaries + 0–5 replicas per shard 6 nodes (1 primary + 0–5 replicas) Scalability and Performance • Throughput scales with number of shards • In-memory capacity up to 9.5 TiB • Throughput limited by 1 primary, 5 replicas • In-memory capacity up to 635 GiB Max connections • Primaries (65,000 x 15 = 975,000)* • Replicas (65,000 x 75 = 4,875,000) • Primary: 65,000 • Replicas: (65,000 x 5 = 325,000) Redis Cluster mode enabled vs disabled
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Feature Enabled Disabled Scaling Operation Online Cluster Resizing • Horizontal Scaling to add/remove shards • Read Scalability to add/remove replicas Vertical Scaling • Writes are blocked • Reads not supported on master node Failover 15–30 sec (Non-DNS) 30-45 sec + additional DNS propagation Failover risk • Writes affected on partial dataset • Reads available • Writes affected on entire dataset • Reads available Cost Example: Assume workload needs 140 GB Similar (Many Smaller nodes) 15 x cache.r4.large ($0.228hr) = $3.42 hour 184.5 GB Similar (Few larger nodes) 1 X cache.r4.8xlarge = $3.64 hr , 203.26 GB Redis Cluster mode enabled vs disabled
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cluster-mode enabled failover Cache node Primary Replica Shard x5 x15 Cache node async replication CW Metric: ReplicationLag
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cache node Primary Replica Shard Cache node async replication Cluster-mode enabled failover Failover Detection
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cache node Primary Replica Shard Cache node async replication Cluster-mode enabled failover Automatic Failover (with no DNS propagation) Test with Failover API SNS Event: ElastiCache:CacheNodeReplaceComplete SNS Event: ElastiCache:FailoverComplete
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 0-5461 reads/ writes Shard 1 Shard 2 Shard 3 Shard 4 Shard 5 5462--10922 10923-163830-2909, 5095-5461 5462-5783, 6876-9830 10923-14199 2910-5094, 9831--10922 No Application Interruption Uniform slot distribution across shards 5784-6875, 14200-16383 Zero downtime - Online re-sharding - scale out Cache node Cache node Cache node Cache nodeCache node
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 0-5461 reads/ writes Shard 1 Shard 2 Shard 3 Shard 4 Shard 5 5462--10922 10923-16383 Uniform slot distribution across shards Cache node Cache node Cache node Cache nodeCache node No Application Interruption Zero downtime - Online re-sharding - scale in
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Online re-sharding— CW alarm trigger … var params = { ApplyImmediately: true, NodeGroupCount: 5, ReplicationGroupId: ‘rep-group-id’, … } elasticache.modifyReplicationGroupShardConfiguration(params, function(err, data) { if (err) console.log(err, err.stack); else console.log(data); }); … Alarm Lambda Function Topic
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Caching In-memory cache relational object API Responses connected data non-relational search analytics application Cache it if you can
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Real-time: Sentiment Analysis Queue (List) , Redis Streams Sentiment Leaderboard Sentiment Data store Ingestion Tools Worker, Consumer Sentiment Analysis Ingest High Velocity (Rank and Query)
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Real-time: AWS IoT Core Rule Generic Lambda function House Lightbulb Thermostat Utility Devices Redis Streams Data Lake Real-time Store Time Series
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Filter Raw Stream Cleansed Stream Raw Stream Parse Stream (RAW) Real-time: Amazon Kinesis Filtering Lambda function Lambda function Parse Stream (Cleansed) Stream (Analytics) RAW Stream (Analytics) Decorate and Filter Raw Data
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Mobile Lambda Function devices authenticate authorize geo-based queries write-back, geo add APIs primary Data store Geospatial and Cached Data
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Rate Limiting Other Resources APIs Application Rate Limiter (Redis Counter) Reduce backend pressure
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Graph & Search Integration Logstash (Redis Channels, List) Buffered data Application Search & Log AnalyticsConnected Data https://github.com/logstash-plugins/logstash-input-redis BLPOP Compliment Graph: Geospatial , Aggregation , Cache Ingest High Velocity
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cluster sizing best practices • Storage—Clusters should have adequate memory • Recommended: Memory needed + 25% reserved memory (for Redis) + some room for growth (optional 10%) • Optimize using eviction policies and TTLs • Scale up or out when before reaching max-memory using CloudWatch alarms • Use memory optimized nodes for cost effectiveness (R5 support ) • Performance—Performance should not be compromised • Benchmark operations using Redis Benchmark tool • For more READIOPS—Add replicas • For more WRITEIOPS—Add shards (scale out) • For more network IO—Use network optimized instances and scale out • Use pipelining for bulk reads/writes • Consider Big(O) time complexity for data structure commands • Cluster Isolation (apps sharing key space)—Choose a strategy that works for your workload • Identify what kind of isolation is needed based on the workload and environment • Isolation: No Isolation $ | Isolation by Purpose $$ | Full Isolation $$$
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudWatch Monitoring • Metric: BytesUsedForCache • Resolution: scale up | out • Metric: CacheHits / Metric: CacheMisses • Aim for +80% Hits/Misses ratio • Resolution: Optimize TTL & Cache Strategy • Metric: CurrConnections • Should be stable • Resolution: Connection Pooling, Scale out • Metric: EngineCPUUtilization • Should not exceed 90% allocation, • Resolution: Scale out • Metric: Evictions > 1 • Resolution: scale up | out • Metric: SwapUsage > few MBs • Resolution: scale up | out Lambda Function Alarm Topic
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Redis max-memory policies Select a max-memory policy based on your workload needs • noeviction: return errors when the memory limit was reached and the client is trying to execute commands that might result in more memory to be used. • allkeys-lru: evict keys trying to remove the less recently used (LRU) keys first. • volatile-lru: evict keys trying to remove the less recently used (LRU) keys first, but only among keys that have an expire set. • allkeys-random: evict random keys to make space for the new data added. • volatile-random: evict random keys to make space for the new data added, but only evict keys with an expire set. • volatile-ttl: evict only keys with an expire set, and try to evict keys with a shorter time to live (TTL) first. • volatile-lfu: evict least frequently used containing an expiration • allkeys-lfu: evict any keys using least frequently used
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Q&A
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lab Time 1. Login to your temp account: (You should have received your temporary account card) 2. Download the lab guide: http://bit.ly/reInventRedis 3. Make sure you are working in: US-EAST-2
  • 43. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. https://aws.amazon.com/elasticache/ John Husemoller @jdhusem Matt Wolff @matwolff John Marciniak @jomarcin David Rodriguez @rodzdavi Michael Labib @mlabib
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.