SlideShare a Scribd company logo
1 of 25
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Overview of Redis with Search and
Graph
Kevin McGehee
Sr. Software Development Engineer
AWS ElastiCache
D A T 3 3 4
Mohan Varthakavi
Sr. Manager, Software Development
AWS ElastiCache
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
Redis overview
Search Integration with Amazon Elasticsearch Service
Graph Integration with Amazon Neptune
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Purpose-built databases
• AWS builds purpose-built solutions to solve problems
• Some use cases can leverage multiple solutions together
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Redis engine
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.
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 Virtual Private Cloud
(Amazon VPC)
HIPAA, PCI, FedRAMP
Encryption at-rest and in-transit
Authentication
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
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.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Open source
Benefits of Amazon Elasticsearch Service
Drop-in replacement with no need to
learn new APIs or skills
Resize your cluster with a few
clicks or a single API call
Deploy into your VPC and
restrict access using security
groups and AWS Identity and Access
Management (IAM) policies
Replicate across Availability Zones,
with monitoring and
automated self-healing
Leverage other AWS services for
seamless data ingestion, security,
auditing and orchestration
Easy to use
Deploy a production-ready
Elasticsearch cluster in minutes
Scalable
Secure Highly available Integrated
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use case #1: Log analytics ingestion
• Elasticsearch used to query structured application logs
• Ingestion pipeline can slow down during surge of log events
• Redis can be used as a fast, in-memory message buffer
• Reduces scaling requirements of downstream components
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Message queueing for log analytics
Logstash
Buffered
log data
( Redis lists )
Search & log analytics
Mobile client
Mobile client
Mobile client
Mobile client
Application
Frontend
Pull batches Processed batch
local batchsize = tonumber(ARGV[1])
local result = redis.call('lrange', KEYS[1], 0, batchsize)
redis.call('ltrim', KEYS[1], batchsize + 1, -1)
return result
Push log data
Administrators
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use case #2: Application log analytics
• Process Elasticsearch logs and push application data into Redis
• Application can query Redis directly
• Advantage of sub-ms access latency with significant throughput
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Leaderboards using log analytics
Logstash
Application data
( sorted sets )
Search & log analytics
Mobile client
Mobile client
Mobile client
Mobile client
Application
Frontend
Existing
pipeline
Update leaders Poll event data
ZINCRBY topreviewers 5 bob123
ZINCRBY topreviewers 1 alicerules0
...
Query leaders
> ZREVRANGEBYSCORE topreviewers inf 0
1) bob123
2) alicerules0
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use case #3: Query caching
• Reduce query latency
• Sub-ms latency for query caching of slower Elasticsearch queries
• Increase overall throughput
• Increase throughput capacity without provisioning more Elasticsearch nodes
• Reduce Elasticsearch provisioning if bottlenecked on throughput
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Query caching Elasticsearch results
Frontend
application
Cached
search
results
Search & log analytics
(1)
Check cache
Query
Elasticsearch
data
(2)
Cache miss:
Issue query
(3)
Cache miss:
Cache result
GET [query]
SET [query] [result]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Neptune
Fast, reliable graph database built for the cloud
Open graph APIs
Gremlin and SPARQL
support
High performance &
scalability
Purpose-built high
performance graph database
engine
Automatically scaling storage
and easily scaling compute
and memory
Availability & durability
Multi-AZ deployments with
read replicas
Instance monitoring &
repair
Continuous Incremental
Backups
Cost-effective
Pay for what you use
Security
Amazon VPC network
isolation
IAM access control
Encryption at rest using
AWS Key Management
Service (AWS KMS)
Fully managed
Easy to use
Amazon CloudWatch integration
Automatic patching
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
User recommendation Graph
• Store restaurant recommendations and friendship connections
RATED
rating: 5
RATED
rating: 7
name: Bob
id: 20123194
User
name: Denny’s
id: 1125923
name: Fancy Grill
id: 2345678
Restaurant
name: Alice
Id: 11041235
User
name: Fish Please
id: 3315963
RATED
rating: 9
RATED
rating: 2
Restaurant Restaurant
FRIENDS_WITH
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use case #1: Data enrichment
• User wants to see nearby restaurants that friends recommended
• Redis natively supports geospatial indexes while Neptune does not
• Query Neptune for friend relationships and Redis for geospatial
relationships
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Geospatial enrichment
> GEORADIUS geo:restaurantids 47.6062 122.3321 10 mi
1) "2345678"
2) "2788539"
3) "3315963"
Frontend
application
Restaurant
geospatial
data
Friend
relationship
data
Query friend
recommendations
Query
nearby
restaurants
Query nearby
restaurants
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use case #2: Pagination of Neptune results
• User wants to paginate graph query
• Neptune supports pagination, but needs to rerun query
• Redis supports lists and sorted sets in-memory
• An entire Neptune result set can be computed once, then fetched from cache over time
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Neptune pagination offload
Application
Query set
cache
Query entire
result set
Cache
result set
(first request)
(first request)
Retrieve page
Paginated queries
LPUSH [session id] [data page 1]
LPUSH [session id] [data page 2]
...
EXPIRE [session id] [seconds]
LINDEX [session id] [n]
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kevin McGehee
mcgehee@amazon.com
Mohan Varthakavi
varthaka@amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

What's hot (20)

Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
Managing Modern Infrastructure in Enterprises (ENT227-R1) - AWS re:Invent 2018
 
Serverless Video Ingestion & Analytics with Amazon Kinesis Video Streams (ANT...
Serverless Video Ingestion & Analytics with Amazon Kinesis Video Streams (ANT...Serverless Video Ingestion & Analytics with Amazon Kinesis Video Streams (ANT...
Serverless Video Ingestion & Analytics with Amazon Kinesis Video Streams (ANT...
 
Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...
Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...
Hands-On Building and Deploying .NET Applications on AWS (DEV331-R1) - AWS re...
 
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
 
Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...
Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...
Under the Hood: How Amazon Uses AWS Services for Analytics at a Massive Scale...
 
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
Architecting for Real-Time Insights with Amazon Kinesis (ANT310) - AWS re:Inv...
 
SaaS Analytics and Metrics: Capturing and Surfacing the Data That's Fundament...
SaaS Analytics and Metrics: Capturing and Surfacing the Data That's Fundament...SaaS Analytics and Metrics: Capturing and Surfacing the Data That's Fundament...
SaaS Analytics and Metrics: Capturing and Surfacing the Data That's Fundament...
 
Shift-Left SRE: Self-Healing with AWS Lambda Functions (DEV313-S) - AWS re:In...
Shift-Left SRE: Self-Healing with AWS Lambda Functions (DEV313-S) - AWS re:In...Shift-Left SRE: Self-Healing with AWS Lambda Functions (DEV313-S) - AWS re:In...
Shift-Left SRE: Self-Healing with AWS Lambda Functions (DEV313-S) - AWS re:In...
 
Migrate Your Hadoop/Spark Workload to Amazon EMR and Architect It for Securit...
Migrate Your Hadoop/Spark Workload to Amazon EMR and Architect It for Securit...Migrate Your Hadoop/Spark Workload to Amazon EMR and Architect It for Securit...
Migrate Your Hadoop/Spark Workload to Amazon EMR and Architect It for Securit...
 
Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...
Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...
Design, Deploy, and Optimize Microsoft SQL Server on AWS (WIN324-R1) - AWS re...
 
Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...
Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...
Enabling a Digital Platform with Microservices Architecture (ARC218-S) - AWS ...
 
Building Your First Serverless Data Lake (ANT356-R1) - AWS re:Invent 2018
Building Your First Serverless Data Lake (ANT356-R1) - AWS re:Invent 2018Building Your First Serverless Data Lake (ANT356-R1) - AWS re:Invent 2018
Building Your First Serverless Data Lake (ANT356-R1) - AWS re:Invent 2018
 
Scale Your SAP HANA In-Memory Database on Amazon EC2 High Memory Instances wi...
Scale Your SAP HANA In-Memory Database on Amazon EC2 High Memory Instances wi...Scale Your SAP HANA In-Memory Database on Amazon EC2 High Memory Instances wi...
Scale Your SAP HANA In-Memory Database on Amazon EC2 High Memory Instances wi...
 
Closing Loops and Opening Minds: How to Take Control of Systems, Big and Smal...
Closing Loops and Opening Minds: How to Take Control of Systems, Big and Smal...Closing Loops and Opening Minds: How to Take Control of Systems, Big and Smal...
Closing Loops and Opening Minds: How to Take Control of Systems, Big and Smal...
 
Real-Time Web Analytics with Amazon Kinesis Data Analytics (ADT401) - AWS re:...
Real-Time Web Analytics with Amazon Kinesis Data Analytics (ADT401) - AWS re:...Real-Time Web Analytics with Amazon Kinesis Data Analytics (ADT401) - AWS re:...
Real-Time Web Analytics with Amazon Kinesis Data Analytics (ADT401) - AWS re:...
 
Ask an Amazon Redshift Customer Anything (ANT389) - AWS re:Invent 2018
Ask an Amazon Redshift Customer Anything (ANT389) - AWS re:Invent 2018Ask an Amazon Redshift Customer Anything (ANT389) - AWS re:Invent 2018
Ask an Amazon Redshift Customer Anything (ANT389) - AWS re:Invent 2018
 
Redshift Advisor Quick Start: Recommendations on Tuning Your Data Warehouse (...
Redshift Advisor Quick Start: Recommendations on Tuning Your Data Warehouse (...Redshift Advisor Quick Start: Recommendations on Tuning Your Data Warehouse (...
Redshift Advisor Quick Start: Recommendations on Tuning Your Data Warehouse (...
 
The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...
The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...
The New Normal for Mission-Critical SAP Workloads (ENT219-R1) - AWS re:Invent...
 
Operationalizing Your Analysis with AWS IoT Analytics (IOT358-R1) - AWS re:In...
Operationalizing Your Analysis with AWS IoT Analytics (IOT358-R1) - AWS re:In...Operationalizing Your Analysis with AWS IoT Analytics (IOT358-R1) - AWS re:In...
Operationalizing Your Analysis with AWS IoT Analytics (IOT358-R1) - AWS re:In...
 
Build a High-Performance, Cloud-Native, Open-Source Platform on AWS & Save Mi...
Build a High-Performance, Cloud-Native, Open-Source Platform on AWS & Save Mi...Build a High-Performance, Cloud-Native, Open-Source Platform on AWS & Save Mi...
Build a High-Performance, Cloud-Native, Open-Source Platform on AWS & Save Mi...
 

Similar to Overview of Redis with Search and Graph (DAT334) - AWS re:Invent 2018

Similar to Overview of Redis with Search and Graph (DAT334) - AWS re:Invent 2018 (20)

Non-Relational Revolution
Non-Relational RevolutionNon-Relational Revolution
Non-Relational Revolution
 
Non-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SFNon-Relational Revolution: Database Week SF
Non-Relational Revolution: Database Week SF
 
Building a Modern Data Warehouse: Deep Dive on Amazon Redshift - SRV337 - Chi...
Building a Modern Data Warehouse: Deep Dive on Amazon Redshift - SRV337 - Chi...Building a Modern Data Warehouse: Deep Dive on Amazon Redshift - SRV337 - Chi...
Building a Modern Data Warehouse: Deep Dive on Amazon Redshift - SRV337 - Chi...
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
 
Workshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data LakeWorkshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data Lake
 
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
Leadership Session: AWS Database and Analytics (DAT206-L) - AWS re:Invent 2018
 
Managed Relational Databases
Managed Relational DatabasesManaged Relational Databases
Managed Relational Databases
 
Choosing the Right Database for My Workload: Purpose-Built Databases
Choosing the Right Database for My Workload: Purpose-Built Databases Choosing the Right Database for My Workload: Purpose-Built Databases
Choosing the Right Database for My Workload: Purpose-Built Databases
 
Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...
Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...
Connecting the dots - How Amazon Neptune and Graph Databases can transform yo...
 
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
 
Building a Data Lake in Amazon S3 & Amazon Glacier (STG401-R1) - AWS re:Inven...
Building a Data Lake in Amazon S3 & Amazon Glacier (STG401-R1) - AWS re:Inven...Building a Data Lake in Amazon S3 & Amazon Glacier (STG401-R1) - AWS re:Inven...
Building a Data Lake in Amazon S3 & Amazon Glacier (STG401-R1) - AWS re:Inven...
 
AWS Data Lake: data analysis @ scale
AWS Data Lake: data analysis @ scaleAWS Data Lake: data analysis @ scale
AWS Data Lake: data analysis @ scale
 
BI & Analytics
BI & AnalyticsBI & Analytics
BI & Analytics
 
Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon RedshiftBuilding a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
 
Choose the right DB for the Job - Builders Day Israel
Choose the right DB for the Job - Builders Day IsraelChoose the right DB for the Job - Builders Day Israel
Choose the right DB for the Job - Builders Day Israel
 
Big data journey to the cloud rohit pujari 5.30.18
Big data journey to the cloud   rohit pujari 5.30.18Big data journey to the cloud   rohit pujari 5.30.18
Big data journey to the cloud rohit pujari 5.30.18
 
Database Freedom. Database migration approaches to get to the Cloud - Marcus ...
Database Freedom. Database migration approaches to get to the Cloud - Marcus ...Database Freedom. Database migration approaches to get to the Cloud - Marcus ...
Database Freedom. Database migration approaches to get to the Cloud - Marcus ...
 
Amazon Athena: What's New and How SendGrid Innovates (ANT324) - AWS re:Invent...
Amazon Athena: What's New and How SendGrid Innovates (ANT324) - AWS re:Invent...Amazon Athena: What's New and How SendGrid Innovates (ANT324) - AWS re:Invent...
Amazon Athena: What's New and How SendGrid Innovates (ANT324) - AWS re:Invent...
 
BI & Analytics - A Datalake on AWS
BI & Analytics - A Datalake on AWSBI & Analytics - A Datalake on AWS
BI & Analytics - A Datalake on AWS
 
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
 

More from Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon 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
 

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
 

Overview of Redis with Search and Graph (DAT334) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Overview of Redis with Search and Graph Kevin McGehee Sr. Software Development Engineer AWS ElastiCache D A T 3 3 4 Mohan Varthakavi Sr. Manager, Software Development AWS ElastiCache
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda Redis overview Search Integration with Amazon Elasticsearch Service Graph Integration with Amazon Neptune
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Purpose-built databases • AWS builds purpose-built solutions to solve problems • Some use cases can leverage multiple solutions together
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Redis engine 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
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 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 Virtual Private Cloud (Amazon VPC) HIPAA, PCI, FedRAMP Encryption at-rest and in-transit Authentication
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use Cases Gaming leaderboards Chat apps Caching Session store Machine learning Real-time analytics Media streaming Geospatial Message queues
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Open source Benefits of Amazon Elasticsearch Service Drop-in replacement with no need to learn new APIs or skills Resize your cluster with a few clicks or a single API call Deploy into your VPC and restrict access using security groups and AWS Identity and Access Management (IAM) policies Replicate across Availability Zones, with monitoring and automated self-healing Leverage other AWS services for seamless data ingestion, security, auditing and orchestration Easy to use Deploy a production-ready Elasticsearch cluster in minutes Scalable Secure Highly available Integrated
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use case #1: Log analytics ingestion • Elasticsearch used to query structured application logs • Ingestion pipeline can slow down during surge of log events • Redis can be used as a fast, in-memory message buffer • Reduces scaling requirements of downstream components
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Message queueing for log analytics Logstash Buffered log data ( Redis lists ) Search & log analytics Mobile client Mobile client Mobile client Mobile client Application Frontend Pull batches Processed batch local batchsize = tonumber(ARGV[1]) local result = redis.call('lrange', KEYS[1], 0, batchsize) redis.call('ltrim', KEYS[1], batchsize + 1, -1) return result Push log data Administrators
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use case #2: Application log analytics • Process Elasticsearch logs and push application data into Redis • Application can query Redis directly • Advantage of sub-ms access latency with significant throughput
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Leaderboards using log analytics Logstash Application data ( sorted sets ) Search & log analytics Mobile client Mobile client Mobile client Mobile client Application Frontend Existing pipeline Update leaders Poll event data ZINCRBY topreviewers 5 bob123 ZINCRBY topreviewers 1 alicerules0 ... Query leaders > ZREVRANGEBYSCORE topreviewers inf 0 1) bob123 2) alicerules0
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use case #3: Query caching • Reduce query latency • Sub-ms latency for query caching of slower Elasticsearch queries • Increase overall throughput • Increase throughput capacity without provisioning more Elasticsearch nodes • Reduce Elasticsearch provisioning if bottlenecked on throughput
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Query caching Elasticsearch results Frontend application Cached search results Search & log analytics (1) Check cache Query Elasticsearch data (2) Cache miss: Issue query (3) Cache miss: Cache result GET [query] SET [query] [result]
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Neptune Fast, reliable graph database built for the cloud Open graph APIs Gremlin and SPARQL support High performance & scalability Purpose-built high performance graph database engine Automatically scaling storage and easily scaling compute and memory Availability & durability Multi-AZ deployments with read replicas Instance monitoring & repair Continuous Incremental Backups Cost-effective Pay for what you use Security Amazon VPC network isolation IAM access control Encryption at rest using AWS Key Management Service (AWS KMS) Fully managed Easy to use Amazon CloudWatch integration Automatic patching
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. User recommendation Graph • Store restaurant recommendations and friendship connections RATED rating: 5 RATED rating: 7 name: Bob id: 20123194 User name: Denny’s id: 1125923 name: Fancy Grill id: 2345678 Restaurant name: Alice Id: 11041235 User name: Fish Please id: 3315963 RATED rating: 9 RATED rating: 2 Restaurant Restaurant FRIENDS_WITH
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use case #1: Data enrichment • User wants to see nearby restaurants that friends recommended • Redis natively supports geospatial indexes while Neptune does not • Query Neptune for friend relationships and Redis for geospatial relationships
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Geospatial enrichment > GEORADIUS geo:restaurantids 47.6062 122.3321 10 mi 1) "2345678" 2) "2788539" 3) "3315963" Frontend application Restaurant geospatial data Friend relationship data Query friend recommendations Query nearby restaurants Query nearby restaurants
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use case #2: Pagination of Neptune results • User wants to paginate graph query • Neptune supports pagination, but needs to rerun query • Redis supports lists and sorted sets in-memory • An entire Neptune result set can be computed once, then fetched from cache over time
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Neptune pagination offload Application Query set cache Query entire result set Cache result set (first request) (first request) Retrieve page Paginated queries LPUSH [session id] [data page 1] LPUSH [session id] [data page 2] ... EXPIRE [session id] [seconds] LINDEX [session id] [n]
  • 24. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kevin McGehee mcgehee@amazon.com Mohan Varthakavi varthaka@amazon.com
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.