Date post: | 01-Jul-2015 |
Category: |
Technology |
Upload: | robert-lehmann |
View: | 6,466 times |
Download: | 1 times |
“Redis ismore than justa key-value store,it’s a lifestyle.
–– Mathias Meyer
a data structure server
hash tables
sets
sorted sets
Fundamental data structuresfor a fundamental API
lists
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
hash tables
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
insertread
updatedelete
HMSETHMGETHMSET
DEL
CRUD
RedisClient.java
a data structure server
hash tables
sets
sorted sets
Fundamental data structuresfor a fundamental API
lists
factory settings hand-tuned
hash-max-zipmap-value 2048
2.54MB 1.62MB
0.5M initial size
The Harry Potter Approach
WWVDWhat Would Voldemort Do
101 @Override102 public int scan(…) {104 logger.warn(⁞ "Voldemort does not support Scan semantics");105 return OK;106 }
db/voldemort/src/com/yahoo/ycsb/db/VoldemortClient.java
sorted sets
user1 user2 user3 user5 user8
1 2 3 5 8…
user1 user2 user3 user5 user8
not that easy
user1 user2 user3 user5 user8
not that easy
record name can be anythingthus: position = hash(name)
sorted sets
50% performance hit
workload A
thro
ugh
pu
t
target
workload E
thro
ugh
pu
t
target
workload F
thro
ugh
pu
t
target
“I think the… problem is… believing thatthere can be“one true datastore”.Different technologies excel at different things.
–– Weixi Yen
“I think the… problem is… believing thatthere can be“one true datastore”.Different technologies excel at different things.
–– Weixi Yen
Memory storage is #1
Redis key space
http://spotfireblog.tibco.com/wp-content/uploads/in-memory-analytics.jpg
bandwidth contentionnetworkmemory
200 ops/secsingle-threaded
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
= 1 KB
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
= 1 KBfactory page size := 32 bytes
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
= 1 KBfactory page size := 32 bytes
values must be swapped in their entirety,even for complex types
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
= 1 KBfactory page size := 32 bytes
values must be swapped in their entirety,even for complex types
= 32 pages
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
= 1 KBfactory page size := 32 bytes
values must be swapped in their entirety,even for complex types
= 32 pages vm-page-size et al
user1234567890field0: abc…field1: def…field2: ghi…field3: jkl…field4: mno…field5: pqr…field6: stu…field7: vwx…field8: yzä…field9: öüß…
= 1 KB
= 32 pages
50% performance hit
32-bit 64-bit
4 GB 8 TB
large pointers
redis-cli INFO
Memory storage is #1
meh, persistence
http://www.flickr.com/photos/generationbass/4827013488/
memory overhead
Memory storage is #1
meh, persistence
http://www.flickr.com/photos/generationbass/4827013488/
memory overhead
load phase fails randomly
http://www.flickr.com/photos/31748439@N06/3026024436/
there are no silver bullets