NoSQL Storage by bestt571

VIEWS: 31 PAGES: 16

redis is a key-value storage system. And like Memcached, which supports relatively more stored value type, including the string (string), list (list), set (set) and zset (ordered set). These data types are supported push / pop, add / remove and take the intersection and difference sets and more extensive operation, and these operations are atomic. On this basis, redis support a variety of different ways of sorting. Like with memcached, in order to ensure efficiency, data is cached in memory. Difference is that redis periodically updated data is written to disk or to modify the operation to write additional log files, and on this basis to achieve a master-slave (master-slave) synchronization.

More Info
									NoSQL Storage
               NoSQL
• “Not Only SQL”
• Relational Databases are not the solution
  for all types of data storage problems
• Built for distributed data sets
• Schema not required
         Why NoSQL
• Massive amounts of data
• Data interconnectedness
• Inconsistent Structure
• Need to scale applications
        CAP Theorem
• Eric Brewer
• Requirements of distributed systems
  • Consistency - all clients see same data
  • Availability - 100% up time
  • Partition Tolerance - system continues to
    work when nodes are disconnected
• Can only satisfy 2 of 3 requirements
    Types of NoSQL
• Key-Value
• Document
• Graph
• Column
           Key-Value
• Scale to huge amounts of data
• Handle massive load
• Data Model: key-value pairs
• Examples: Voldemort, Amazon Dynamo,
  Redis
• LinkedIn, pretty much anyone who needs a
  cache
           Column Oriented
     •   Based on Google’s BigTable

     •   Each key is associated with many columns




     •   Examples: HBase, Hypertable, Cassandra

     •   Twitter, digg, Facebook, Google
http://www.scribd.com/doc/24334297/HBase-schema-design-case-studies
                           Document
        • Similar to Key-Value
        • Collection of key-values (document)
        • Examples: CouchDB, MongoDB, Redis
        • sourceforge, bit.ly, foursquare
{ username: "jones",       { username: "smith",      { username: "sarah",
    likes: 20,                 likes: 200,               likes: 10,
    text: "Hello world!"       text: "Hello moon!"       text: "Hello mars!"
  }                          }                         }
               Graph
• Nodes
• Nodes have properties (key-value)
• Multiple relationships can exist between
  nodes
• Social Network
• Examples: Neo4j, Jena, Sesame
                     Graph
                                               ABL1
                Imatinib
Legend
                                target
    Gene
    Disease
                                      associatedGene
   Compound
    Predicate
                       possibleDrug



                                 Leukemia
    Querying NoSQL
• Key-Value
• Graph Traversal (SPARQL)
• Map Reduce
     Key-Value Query
• value = datastore.get(key)
                          Graph
     • SPARQL
# prefix declarations
PREFIX foo: <http://example.com/resources/>
...
# dataset definition
FROM ...
                         PREFIX foaf: <http://xmlns.com/foaf/0.1/>
# result clause
                         SELECT ?name
SELECT ...
                         WHERE {
# query pattern
                             ?person foaf:name ?name .
WHERE {
                         }
    ...
}
# query modifiers
ORDER BY ...

     http://www.cambridgesemantics.com/2008/09/sparql-by-example/
                     Map Reduce




http://www.cs.berkeley.edu/~ballard/cs267.sp11/hw0/results/htmls/Muzaffar.html
            http://www.gridgain.com/images/mapreduce_small.png
        Example: Redis
• Redis is a key-value store, with a twist
• Values can be strings, hashes, lists, sets and
  sorted sets
• Memory based - entire data set must fit in
  memory (disk snapshots periodically)
• Supports replication
• Publish/Subscribe
     Redis Use Cases
• Cache
• Real Time Statistics
• Atomic counting (“like” button)
• Auditing (sets of ip addresses)

								
To top