Skip to the content ForoHackers
Log inJoin

NoSQL: start here

NoSQL
#2905 · · Quote · Report

NoSQL is a loose name for databases that depart from the relational table model: key-value stores, document stores, wide-column stores and graph databases. Each trades some of the relational toolbox, such as joins or strict schemas, for an advantage in scale, flexibility or a particular access pattern.

Key concepts

  • Data models: key-value for fast lookups, documents for nested records, wide-column for huge sparse tables, graphs for relationships.
  • Design from queries: you often shape the data around the questions you will ask, duplicating it if needed.
  • Partitioning: splitting data across machines by a key, so a poor key creates hot spots.
  • Replication and consistency: copies on several nodes raise availability but may briefly disagree.
  • Schema flexibility: records need not share a shape, so the application must handle old and new versions.

Vocabulary

  • CAP theorem: during a network partition a system must choose between consistency and availability.
  • Eventual consistency: replicas converge to the same value if updates stop.
  • Denormalisation: storing the same fact in several places to avoid joins.
  • TTL: time to live, the age after which a record expires on its own.

What to study, in order

  1. Relational basics first, so you know what you are giving up.
  2. Use a key-value store as a cache and observe expiry and eviction.
  3. Model a small application, such as a blog, in a document store and list the queries it supports well.
  4. Try a graph database on a social network and write a friends-of-friends query.
  5. Read about partitioning and replication, and simulate a node failure.
  6. Take a relational schema and redesign it for a wide-column store, noting every compromise.

Related tags

#databases #sql #distributed-systems #big-data

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply