Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use...

35

Transcript of Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use...

Page 1: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely
Page 2: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Build Highly Resilient Applications with Redis Enterprise Clustering MAY 2019 | MANUEL HURTADO

Page 3: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Redis Introduction

Page 4: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Most Loved Databases 2017, 2018 & 2019Stack Overflow survey, among >100K developers

% of devs who expressed interest in continuing to develop with a database

Page 5: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Most Popular Database ContainerNumber of containers (in Billions) launched at Docker Hub (as of Dec 2018)

0.05

0.20

0.59

1.14

1.17

Page 6: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Redis Top Differentiators

Simplicity Extensibility PerformanceNoSQL Benchmark

1

Redis Data Structures

2 3

Redis Modules

6

Lists

Hashes

Bitmaps

Strings

Bit field

Streams

Hyperloglog

Sorted Sets

Sets

Geospatial Indexes

Page 7: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Performance: The Most Powerful Database

Highest Throughput at Lowest Latency in High Volume of Writes Scenario

Least Servers Needed to Deliver 1 Million Writes/Sec

Benchmarks performed by Avalon Consulting Group Benchmarks published in the Google blog

7

1

Serv

ers

use

d t

o a

chie

ve 1

M w

rite

s/se

c

Page 8: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Simplicity: Data Structures - Redis’ Building Blocks

Lists

[ A → B → C → D → E ]

Hashes

{ A: “foo”, B: “bar”, C: “baz”

}

Bitmaps

0011010101100111001010

Strings

"I'm a Plain Text String!”

Bit field

{23334}{112345569}{766538}Key

8

2

”Retrieve the e-mail address of the user with the highest bid in an auction that started on July 24th at 11:00pm PST”

ZREVRANGE 07242015_2300 0 0=

Streams🡪 {id1=time1.seq1(A:“xyz”, B:“cdf”),

d2=time2.seq2(D:“abc”, )}🡪

Hyperloglog

00110101 11001110

Sorted Sets

{ A: 0.1, B: 0.3, C: 100 }

Sets

{ A , B , C , D , E }

Geospatial Indexes

{ A: (51.5, 0.12), B: (32.1, 34.7)

}

Page 9: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Extensibility: True Multi-Model Functionality for All Use Cases

9

• Implemented by Redis Modules, independent of the Redis core

• Add-ons that use a Redis API to seamlessly support additional use cases and data structures

• Loosely coupled design, i.e. load only models needed for your use case

• Optimal data structure implementation for JSON, Graph, Search (and other) functionality, not just APIs

• Add new capabilities and data structures to Redis – in speeds similar to normal Redis commands

• Redis Enterprise Modules are tested and certified by Redis Labs

3

SearchJSON

Graph

ML

5X Faster search and throughput

Serves models 2000 times faster

Based on GraphBLAS technology

Native JSON handling

Page 10: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Real Time Analytics

User Session Store

Real Time Data Ingest

High Speed Transactions

Job & Queue Management

Time Series Data Complex Statistical Analysis

Notifications Distributed Lock Content Caching

Geospatial Data Streaming Data Machine Learning

Search

Uniquely Suited to Modern Use CasesA full range of capabilities that simplify and accelerate next generation applications

Page 11: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Highest Performance at Any Use Case

11

ML Serving – x2,000

Search – x5 Graph – x400Se

rver

s u

sed

to

ach

ieve

1M

w

rite

s/se

cNoSQL – x150

Streams – x500

Page 12: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Redis Enterprise Architecture

Page 13: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

What is a Redis Enterprise cluster

13

Database Types

• Simple database (single master shard)

• Highly available (HA) database

• Clustered database (no replication)

• Clustered HA database

Page 14: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Shared-Nothing, Linearly Scalable, Multi-Tenant, Symmetric Architecture

14

Separation between the data path and and the control path components. Benefits:

• Performance

• Availability

• Security

• Manageability

Page 15: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Redis Enterprise Cluster Components

15

Page 16: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Linear Scaling with Redis Enterprise

Page 17: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Scaling Shards and NodesScaling Up

17

Page 18: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Scaling Shards and NodesScale out, Rebalancing, Resharding

18

Page 19: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Scaling Proxies

19

Page 20: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Scalability with Open Source (OSS) Cluster API

20

Page 21: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Scaling ‘Read’ using ‘Replica-Of’

21

Page 22: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Highly Available Redis

Page 23: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Redis Enterprise: HA system with only two replicas

23

The Cost of 90GB Dataset HA Deployment on AWS (reserved instances)

Page 24: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

High Availability: Redis shard Failure

Auto-failover

P PP P P

M R M MR RM

1 2 21 21 21

Slave sync. Re-balancing

Redis 1 fails Redis 1 recovers

P P P

Page 25: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

High Availability: Proxy Failure

P

M R RM RM RM

1 2 21 21 21

P P P

Proxy fails Proxy recovers

P P

Page 26: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

High Availability: Node Failure

Auto-failover

M R M MR

1 2 21 21

Replica sync.

Node fails Node recovers

P PP P

Page 27: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Watchdogs

27

• Node watchdog: Monitors all processes running on a given node.

• Cluster watchdog – Responsible for the health of the cluster nodes and uses a gossip protocol to manage the membership of the nodes in the cluster.

Page 28: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Multi-AZ (Availability-Zone) / Rack Deployment

28

Conditions required• Three or more cluster nodes, with total

number being uneven

• Three or more AZs/racks, with total number being uneven

• The number of nodes in a given AZ/rack should always be a minority

• Network latency between the AZ/rack should be <10ms

Page 29: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Redis Enterprise Geo Distribution

Page 30: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Active-Passive Geo Distribution

30

Replica – of: unidirectional replication between DBs• Each source several destinations (one-to-

many)

• Each destination replicated from several sources (many-to-one)

• Each destination can be a source (chained replication)

• Each database different database settings, and different cluster settings

• Automatic compression

• Optional encryption

Page 31: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Active - Active Geo Distribution (CRDT-Based)

31

CDRT (Conflict-free Replicated Data Types)

• High Performance: Read and write with low local sub-millisecond latency

• Guaranteed data consistency: CRDT based: The datatypes are conflict-free by design. All databases eventually converge automatically to the same state with strong eventual consistency. Supports causal consistency executing read and write operations in an order that reflects causality

• Simplifies the app design: Develop as if it’s a single app in a single geo, we take care of all the rest

Page 32: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Solutions that benefit from Redis Enterprise with Active-Active support

Geo Distributed Trading/Bidding - Auctions, Bids/Asks: Lists/Sorted Sets tracking Bids and

Asks

Dashboards & Scoreboards- Tracking Geo Distributed Scoreboards: Sorted Sets

tracking ordered scores

Real-time Metering Apps- Tracking Usage/Consumption: Sets/Lists Tracking

Consumption Events

And more…..

Fraud Mitigation- Geo Distributed Event Tracking: Sets Gathering Geo

Distributed Events

Social Engagement Apps- Encoding Social Engagement: Distributed Counters for

“Likes”, “Shares”, “Retweets”

Collaboration Apps- Constructing Smart Timelines: Merged Lists Ordering Posts

- Instant Messaging & Conversation Tracking: Merged Lists

Ordering Conversations

Page 33: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Demo

Page 34: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Demo

• DB Creation

• Client load (memtier_benchmark)

• UI Console

• rladmin

• DB Scaling: sharding

• Failover scenarios

Page 35: Build Highly Resilient Applications with Redis Enterprise ... · the Redis core •Add-ons that use a Redis API to seamlessly support additional use cases and data structures •Loosely

Thank you!redislabs.com

35