Slide 1

Slide 1 text

Scalable Caching for Microservices

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Internet Scale Caching @ Netflix 3 “The Netflix customer experience relies heavily on caches to provide a high-volume, low latency, globally available data layer that backs our stateless services. Throughout a typical customer experience, from sitting down on the couch through playing a movie, caches play a role in every interaction.” #CachesEverywhere http://bit.ly/netflix-caching-2016

Slide 4

Slide 4 text

Internet Scale Caching @ Netflix 4

Slide 5

Slide 5 text

Internet Scale Caching @ Netflix 5

Slide 6

Slide 6 text

➔ ➔ ➔ ➔ ➔ ➔

Slide 7

Slide 7 text

Introducing Pivotal Cloud Cache (PCC) 7 • • • • • • •

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

2 sides of a coin ● ○ ○ ● ○

Slide 10

Slide 10 text

Create Service Plans Define Quotas Deploy PCC Broker Quotas - Max Cluster Size - Max # of Clusters On-Demand Service Broker - OpsMan Tile - Register with Marketplace Define Plans - Define VMs - Define Memory - Define CPU - Define Disk Size

Slide 11

Slide 11 text

On-Demand Service ● Eliminate the “noisy neighbor” problem when one application hogs resources on a shared cluster ● No need to pre-provision a fixed quantity of IaaS resources ● Scale resource consumption linearly with need, without having to plan for pre-provisioning ● App developers get more control over resources, and do not have to acquire them through the operator

Slide 12

Slide 12 text

Service-Service for Devs: Create PCC Cluster ● ● ●

Slide 13

Slide 13 text

Binding Application to PCC Service

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Scalable Data and Session Caching ● ● ● ● 1 2 Cache Server Cache Server Cache Server Locator 1 2 3 3 1 Locator PCC Client Connection Pool 54.209.251.110 54.209.251.111 54.209.251.112 Locator Cache Server 2 54.209.251.113 PCF AZ 1 PCF AZ 2

Slide 16

Slide 16 text

PCC Topology Members Cache Server • In-Memory Storage for Data Regions • Standard PCC Process with one Cache Server per JVM Cache Server Cache Server Cache Server Locator Locator • Cluster Discovery & Config • Load Balancing for Servers • Cache Server Cache Server Cache Server Locator

Slide 17

Slide 17 text

Regions 17 ● Synonymous to a Table in NoSQL terminology ● Stores Data in pairs with unique Keys ● Divided into buckets across Cache Members

Slide 18

Slide 18 text

Regions 18 Replicated Partitioned GEM Server GEM Server GEM Server GEM Server GEM Server GEM Server HASH

Slide 19

Slide 19 text

Data Aware Clients Locator PCC Client Connection Pool Cache Server Cache Server Partitioned Region Cache Server 0 23 4 11 44 45 72 18 Total 113 Buckets (Configurable) 2 3 Target Bucket = Hash(Key) % Number of Buckets 1

Slide 20

Slide 20 text

Failing data copies are replaced transparently Data is replicated to other clusters and sites (WAN) Split Brain Detection is enabled Client and cluster disconnections are handled gracefully Data is persisted on local disk for ultimate durability “split brain”

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Design Pattern: Look-Aside Caching 22 https://github.com/Pivotal-Field-Engineering/pad-pcc-demo

Slide 23

Slide 23 text

Cross PCF Foundations Active-Active Replication 23 WAN Replication across Foundations, across Clouds

Slide 24

Slide 24 text

Cross PCF Foundations Active-Active Replication Pivotal Application Service Pivotal Application Service East Foundation Central Foundation Services Network 10.0.16.0/26 ERT Network 10.0.8.0/24 Services Network 10.0.24.0/26 ERT Network 10.0.8.0/24 Google VPN Gateway Secure VPN Tunnel Pivotal Application Service Google VPN Gateway

Slide 25

Slide 25 text

Demo: Active - Active Data Replication between PCF Foundations

Slide 26

Slide 26 text

Client Side Eventing Client Subscriptions ○ Client interest in server side event changes ○ Filter events based on RegEx Interest Continuous Query(CQ) ○ Register interest through server side queries ○ Suitable for creating dashboards

Slide 27

Slide 27 text

PCC Client Subscriptions

Slide 28

Slide 28 text

Front-ending a RDBMS (In-line Caching) ● ● 1000s of transactions per second 100s of transactions per second

Slide 29

Slide 29 text

POS Next Best Offer: Conceptual Demo

Slide 30

Slide 30 text

High level Architecture 30

Slide 31

Slide 31 text

Transaction Flow

Slide 32

Slide 32 text

Offers Flow 32

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Cluster Scaling Out cf update-service pcc-prod-cluster -c '{"num_servers": 6}'

Slide 35

Slide 35 text

Cluster Monitoring Dashboard

Slide 36

Slide 36 text

Monitoring PCC Cluster: Node Failure

Slide 37

Slide 37 text

No content