• Save
Nosql taiwan 2012_03_31
Upcoming SlideShare
Loading in...5
×
 

Nosql taiwan 2012_03_31

on

  • 3,382 views

Talk @ NoSQL Taiwan

Talk @ NoSQL Taiwan

Statistics

Views

Total Views
3,382
Views on SlideShare
1,542
Embed Views
1,840

Actions

Likes
3
Downloads
0
Comments
0

6 Embeds 1,840

http://devpoga.wordpress.com. 1142
http://devpoga.wordpress.com 688
http://www.linkedin.com 5
http://webcache.googleusercontent.com 3
https://twitter.com 1
https://devpoga.wordpress.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • 多少人用過MySQL\n多少人聽過/用過Redis\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Nosql taiwan 2012_03_31 Nosql taiwan 2012_03_31 Presentation Transcript

  • based on real story Poga 2012.03.31
  • 你好 안녕salut Hi こんにちは ciao Hallo
  • iPoga
  • iwear many hats
  • iwear many hatsbuild products
  • Product released Let’s PARTY?
  • DatabaseCPU Utilization
  • Performance Degrading = Unhappy User = Less Profit
  • Complex QueriesInefficient schema
  • Limited Time
  • JustADD itto your stack
  • a c e p lN o t Re Just ADD it to your stack
  • Special Simple In-memoryPerformance Atomic
  • Special Simple In-memoryPerformance Atomic
  • Management Problem a.k.a. “We don’t have a MIS”
  • Dependency Feb 25, 2009 Oct 14, 2011 Mar 31, 2012 Redis 2.4 First external dependencyFirst public beta jemalloc
  • Installation Feb 25, 2009 Oct 14, 2011 Mar 31, 2012 Redis 2.4 First external dependencyFirst public beta jemalloc make install make install
  • Stable
  • Special Simple In-memoryPerformance Atomic
  • Special Simple In-memoryPerformance Atomic
  • Redis In-MemoryHigh Performance Data Structures Persistence Memcached Replication In-Memory ... High Performance Simple Key-Value
  • Data StructuresList, Set, Sorted Set, Hash, String http://redis.io/commands
  • Every command in Redis is manipulating a data structureUnderstand your problem http://nosql.mypopescu.com/post/18977451039/redis-guide-what-each-redis-data-type-should-be-used
  • Special Simple In-memoryPerformance Atomic
  • Special Simple In-memoryPerformance Atomic
  • =
  • FASThttp://redis.io/topics/benchmarks for real
  • Special Simple In-memoryPerformance Atomic
  • No Race Condition every command in redis is atomic use redis as a incremental counter“There are very few systems that support an “increment and return” operation, and Redis is one of them (Oracle sequences are another).” http://nateware.com/2010/02/18/an-atomic-rant/
  • No Race Condition every command in redis is atomicCombine multiple command: still atomic! MULTI SET key 123 SET key2 456 EXEC Warning: Don’t confuse with transaction
  • Special Simple In-memoryPerformance Atomic
  • i
  • Did I make any changes to MySQL? NO It’s still our main database
  • Did I solve the problem? YESsolve complex queries via Redis data structure
  • Happy Database Add Redis to stack
  • How?Sorted Set: Per user notification String: API request limiter String, List: Request logging List: Job Queue
  • Real World = RiskPersistence Replication Sharding
  • Persistence RDB AOF
  • RDB• Snapshot• Compact• .rdb file can be transfered to other backup system• Chances to lose data
  • AOF• logs of every write operation• durable• bigger file size
  • You want a degree of safetycomparable to PostgreSQL? Just use BOTH
  • Replication SlaveMaster Slave Slave
  • Replication• Read-only salves• Save on slaves
  • Sharding• Memory is limited• Split data into multiple redis servers
  • Presharding Multiple MachineSingle Machine Redis instanceRedis instance Redis instanceRedis instanceRedis instance Redis instanceRedis instance Redis instanceRedis instance Redis instance
  • Some Case Study• Resque• Rubygems.org• Tumblr• Instagram
  • ResqueHigh Performance Job Queue https://github.com/blog/542-introducing-resque
  • Rubygems.org feature switch API request limit Logging Job Queue http://www.scribd.com/doc/34269414/Redis-Persistence-Power
  • Tumblr Per-user Notification30,000 request/s per server http://engineering.tumblr.com/post/7819252942/staircar-redis-powered-notifications
  • InstagramSimple Key-value mapping 1/3 cost on hardware http://engineering.tumblr.com/post/7819252942/staircar-redis-powered-notifications
  • iCross server temporary file sharing Redis string is binary-safe
  • Future
  • Lua Scripting Watchdog Future
  • Lua Scripting AtomicSaving bandwidth between servers
  • Sum up 200,000 valuesRuby Redis ... 200,000 times
  • Sum up 200,000 values, with Lua scripting Ruby Redis 1 request
  • Query Data Model Scripting LanguageMySQL Relational Table SQLRedis Data Structures Lua Lua
  • Watchdog Let Redis monitor itself Like slow queries in MySQLMore information to diagnose problem
  • Lua Scripting Watchdog Bright Future
  • = Unique
  • Unique= Not replacing anyone Job security of other database
  • What will u get
  • More life less costHappy User
  • Thank you question? @devpoga