8. Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
9. Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
New NVMe based SSD I3 Instances
10. I3 (NVMe) are x2.6 Faster and 80% Cheaper than I2 (SATA)
Single node @ <1msec latency
11. Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
New NVMe based SSD I3 Instances
New Flash-GT card with multiple NVMes integrated
12. Flash Memory - What Has Changed During Last Year
New NVMe based local SSD that can be attached to a Cloud Instance
New NVMe based SSD I3 Instances
New Flash-GT card with multiple NVMes integrated
New 3D XPoint chipset on NVME Devices
13. Redise Flash + Intel® Optane™ SSD
2040
1380
590
728
142
64
0
500
1000
1500
2000
2500
95% 85% 50%
KOps/sec
RAM hit ratio
item size = 1000B; read/write = 50%/50%
Optane
P3700
Up to x9
Similar to what runs on:
34. Real World Example
• Ads serving company
• Need to serve 20,000 ads/sec @ 50msec data-center latency
• Runs 1k campaigns
35. Real World Example
• Runs 1k campaigns 1K random forest
• Each forest has 15K trees
• On average each tree has 7 levels (depth)
20K x 1K x 15K x 3.5 = 1.05 trillion ops/sec
36. Challenge #2 - Accurate Models are Expensive to Serve!
Item Calculation Total
Max ops/sec on the
strongest AWS
instance vcore
2.6Ghz x
0.9 (OS overhead) x
0.1 (10 lines of code per ops) x
0.1 (Java overhead)
23.4 million
# of vcores needed 1.05 trillion / 23.4 million 44,872
# of c4.8xlarge
instances needed
44,872 / 36 1,247
Total cost
reserved instances
1,247 x 9213 ~$11.5M/yr
37. Ads Serving Use-Case w/ and w/o Redise + ML
Homegrown
1,247 x c4.8xlarge 35 x c4.8xlarge
Cut computing infrastructure by
97%
38. How ML/DL Should be Severed
(1) Training (2) Creating a model (3) Serving the model
48. The Feature List is Long
1. Full-Text indexing of multiple fields in documents
2. Incremental indexing without performance loss
3. Document ranking (provided manually by the user at
index time)
4. Complex Boolean queries with AND, OR, NOT operators
between sub-queries
5. Optional query clauses
6. Prefix based searches
7. Field weights
8. Auto-complete suggestions (with fuzzy prefix
suggestions)
9. Exact Phrase Search, Slop based search
10. Stemming based query expansion in many
languages (using Snowball)
11. Support for custom functions for query expansion
and scoring (see Extensions)
12. Limiting searches to specific document fields (up
to 8 fields supported)
13. Numeric filters and ranges
14. Geo filtering using Redis' own Geo-commands
15. Supports any utf-8 encoded text
16. Retrieve full document content or just ids
17. Automatically index existing HASH keys as
documents
18. Document deletion and updating with index garbage
collection.
77. Challenge #2 – Conflict Resolution for Complex Data-Types
• Application level solution too complex to write
• LWW (Last Write Wins) doesn’t work for many of the Redis use cases, e.g.:
• Counters
• Sets
• Sorted Sets
• Lists
• Modules’ new datatypes
79. CRDT
• Years of academic research
• Based on consensus free protocol
• Strong eventual consistency
• Built to resolve conflicts with complex data types
82. Solving Conflicts – Counters
Replica A:
C = 500
Replica B:
C = 500
Replica C:
C = 500
83. Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
Replica C:
C = 500
84. Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
DECRBY 300
Replica C:
C = 500
85. Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
DECRBY 300
Replica C:
C = 500
INCRBY 1000
86. Solving Conflicts – Counters
Replica A:
C = 500
INCRBY 200
Replica B:
C = 500
DECRBY 300
Replica C:
C = 500
INCRBY 1000
Convergence Function (commutative):
500 + ΣC(i) =
= 500 +200 -300 +1000
= 1400
87. Solving Conflicts – Sets
Replica A:
S = {A, B, C}
Replica B:
S = {A, B, C}
Replica C:
S = {A, B, C}
88. Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
Replica C:
S = {A, B, C}
89. Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
SADD A
Replica C:
S = {A, B, C}
90. Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
SADD A
Replica C:
S = {A, B, C}
SREM A
91. Solving Conflicts – Sets
Replica A:
S = {A, B, C}
SADD D
Replica B:
S = {A, B, C}
SADD A
Replica C:
S = {A, B, C}
SREM A
Convergence Function (associative):
• S = S + D + A - A =
{A, B, C, D}
• Observed Removed + Add wins
92. Solving Conflicts – Sorted Sets
Replica A:
SS =
{A:35, B:23, C:4}
Replica B:
SS =
{A:35, B:23, C:4}
Replica C:
SS =
{A:35, B:23, C:4}
93. Solving Conflicts – Sorted Sets
Replica A:
SS =
{A:35, B:23, C:4}
Replica B:
SS =
{A:35, B:23, C:4}
Replica C:
SS =
{A:35, B:23, C:4}
Convergence Function
(associative & commutative):
Counters + Sets
97. What’s Unique About Redis-CRDT
• Based on a Redis module (CRDB)
• Support bi-direction replication
• Multiple topologies
• Solves a new set of problems
• Counters deletion
• Expiry
• Cluster configuration
• Etc.
RingFully-Connected
98. A Deep Dive on Multi-Master:
Salon 8 @ 3:15 pm