Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Redis

 Redis

Redis description and comparison with other nosql dbs

Foredoomed

June 28, 2013
Tweet

More Decks by Foredoomed

Other Decks in Technology

Transcript

  1. Concerns of Web 2.0 • RDBS features : 1. Complicated

    SQL querys(join) 2. Real time read and write 3. Consistent transaction • High level requirement: 1. High scalability and availability 2. High performance of reading tons of data 3. High performance of concurrent reading & writing
  2. Jim Gray(received the Turing Award in 1998) said “Memory is

    the new Disk, Disk is the new Tape”.
  3. Cache Everywhere • Opcode Cache Compiles your code, speeds up

    execution • Data/User Cache Typical Key-Value storage • Reverse Proxy Cache Cache in between code and browser • Browser Cache Cache on the browser
  4. NoSQL Databases Storage Type Written language Characteristics Replication Redis Key-Value

    C Consistency Partition Tolerance Persistence Master/slave memcached Key-Value C Consistency Partition Tolerance N/A mongoDB Document C++ Consistency Partition Tolerance Persistence Master/slave CouchDB Document Erlang High Availability Partition Tolerance Persistence Multi-master replication Cassandra Column Java High Availability Partition Tolerance Persistence N/A HBase Column Java Consistency Partition Tolerance Persistence Master/slave
  5. NoSQL Databases Best Use Redis Rapidly changing data, frequently written,

    rarely read statistical data memcached Cache, small pieces of data with many concurrent connections mongoDB Dynamic queries, frequently written, rarely read statistical data CouchDB Accumulating, occasionally changing data with pre-defined queries Cassandra When you write more than you read (logging) HBase Random read write to large database
  6. BSD License Redistribution and use in source and binary forms,

    with or without modification, are permitted provided that the following conditions are met: • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. • All advertising materials mentioning features or use of this softwaremust display the following acknowledgement: This product includes software developed by the <organization>. • Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  7. Advantages • Extremely fast: 110000 SETs/s & 81000 GETs/s •

    Rich Data types: strings, hashes, lists, sets and sorted sets • Atomic operation • Snapshotting(Asynchronous persistence) • TTL • Single-threaded(No contention)
  8. Risk & Disaster Recovery • No backups means huge risk

    of data disappering 1.Snapshotting: save 900 1, save 300 1, save 60 10000 • Disaster Recovery 1.RDB(Snapshotting): save 900 1, save 300 1, save 60 10000 2.AOF(Append-only file): appendfsync always, appendfsync everysec, appendfsync no • Consistent hashing
  9. Supported languages ActionScript, C, C++, C#, Clojure, Common Lisp, Dart,

    Erlang, Go, Haskell, Haxe, Io, Java, Node.js, Lua, Objective-C, Perl, PHP, Pure Data, Python, R, Ruby, Scala, Smalltalk and Tcl.