0
NoSQL and Web scalability
Luca Bonmassar
NoSQL - introduction
• A database that does not expose an SQL
interface (negative definition)
• Not a news in the computer...
Why NoSQL?
performance, scalability
Does it fit in my project?
Memcached
• A key - value storage, data is serialized
• No persistent storage, data expires
• A new layer between applicat...
Memcached protocol
• Human readable protocol
• Set (key, val, expire)
• Get (key), mget(key)
• Delete (key)
• Same logical...
Access patterns
• select * from table where p1 = property1
and p2 = property2 and p3 = property3
• key =
vs
Access patterns
• select * from table where p1 = property1
and p2 = property2 and p3 = property3
• key = property1 propert...
Access patterns
• select * from table where p1 = property1
and p2 = property2 and p3 = property3
• key = property1 propert...
Access patterns
• select * from table where p1 = property1
and p2 = property2 and p3 = property3
• key = MD5( )property1 p...
Memcached - workflow
Memcached - workflow
Memcached - workflow
SQL DB
Memcached - workflow
SQL DB
Memcached
Sharding
Routing requests
• A-F
• G-N
• O-S
• T-Z
user Foo
user Puf
user Uwe
NoSQL + sharding
• Split data into multiple servers
• Use keys as shard entries
NoSQL + sharding
• Split data into multiple servers
• Use keys as shard entries
key: bae61f3f62f342b3c4d7f0d8dd128365
NoSQL + sharding
• Split data into multiple servers
• Use keys as shard entries
key: bae61f3f62f342b3c4d7f0d8dd128365key: ...
MemcacheDB
• A Memcached server with BerkleyDB
storage
• Same interface as Memcached, can be
used where Memcached is alrea...
Memcached
MemcacheDB - workflow
SQL DB
Memcached
MemcacheDB - workflow
MemcachedMemcacheDB
MemcacheDB - workflow
MemcacheDB - performance
0
22500.0
45000.0
67500.0
90000.0
read/s
write/s
MySQL MemcacheDB Memcached
key: 16
value: 100B
Cons ?
NoSQL references
• memcachedb.org
• memcached.org
• nosql.mypopescu.com
• technoroy.blogspot.com/2008/07/shard-
database-d...
Thank you!
Any questions?
luca@coderloop.com
linkedin.com/in/lucabonmassar
www.coderloop.com
Upcoming SlideShare
Loading in...5
×

Webtech Conference: NoSQL and Web scalability

1,464

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,464
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Webtech Conference: NoSQL and Web scalability"

  1. 1. NoSQL and Web scalability Luca Bonmassar
  2. 2. NoSQL - introduction • A database that does not expose an SQL interface (negative definition) • Not a news in the computer science • Many subcategories: – BigData – Column stores – Document databases – Key-value stores – Graph Databases SQL
  3. 3. Why NoSQL? performance, scalability
  4. 4. Does it fit in my project?
  5. 5. Memcached • A key - value storage, data is serialized • No persistent storage, data expires • A new layer between application and database • Application must manage cache explicitely • Performance boost
  6. 6. Memcached protocol • Human readable protocol • Set (key, val, expire) • Get (key), mget(key) • Delete (key) • Same logical interface of a Map (hash)
  7. 7. Access patterns • select * from table where p1 = property1 and p2 = property2 and p3 = property3 • key = vs
  8. 8. Access patterns • select * from table where p1 = property1 and p2 = property2 and p3 = property3 • key = property1 property2 property3 vs
  9. 9. Access patterns • select * from table where p1 = property1 and p2 = property2 and p3 = property3 • key = property1 property2 property3:: :: vs
  10. 10. Access patterns • select * from table where p1 = property1 and p2 = property2 and p3 = property3 • key = MD5( )property1 property2 property3:: :: vs
  11. 11. Memcached - workflow
  12. 12. Memcached - workflow
  13. 13. Memcached - workflow SQL DB
  14. 14. Memcached - workflow SQL DB Memcached
  15. 15. Sharding
  16. 16. Routing requests • A-F • G-N • O-S • T-Z user Foo user Puf user Uwe
  17. 17. NoSQL + sharding • Split data into multiple servers • Use keys as shard entries
  18. 18. NoSQL + sharding • Split data into multiple servers • Use keys as shard entries key: bae61f3f62f342b3c4d7f0d8dd128365
  19. 19. NoSQL + sharding • Split data into multiple servers • Use keys as shard entries key: bae61f3f62f342b3c4d7f0d8dd128365key: bae61f3f62f342b3c4d7f0d8dd128365 shard index data key
  20. 20. MemcacheDB • A Memcached server with BerkleyDB storage • Same interface as Memcached, can be used where Memcached is already being used • Performance are comparable to Memcached
  21. 21. Memcached MemcacheDB - workflow SQL DB
  22. 22. Memcached MemcacheDB - workflow
  23. 23. MemcachedMemcacheDB MemcacheDB - workflow
  24. 24. MemcacheDB - performance 0 22500.0 45000.0 67500.0 90000.0 read/s write/s MySQL MemcacheDB Memcached key: 16 value: 100B
  25. 25. Cons ?
  26. 26. NoSQL references • memcachedb.org • memcached.org • nosql.mypopescu.com • technoroy.blogspot.com/2008/07/shard- database-design.html
  27. 27. Thank you! Any questions? luca@coderloop.com linkedin.com/in/lucabonmassar www.coderloop.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×