2013年10月7日 星期一

NoSQL–Types of Stores

Key-Value Stores (MemcacheDB, Voldemort, DynamoDB, Dynomite, Redis, Riak, Windows Azure)

Document Stores (CouchDB, MongoDB)

Wide Column Stores (Hbase, Hadoop, Cassandra)

Graph Databases (Neo4j)

 

Key-Value Stores

1. The most common; not necessarily the most popular

2. Has rows, each with something like a big dictionary/associative array. Schema may differ from row to row

3. Common on Cloud platforms. e.g. Amazon SimpleDB, Azure Table Storage

4. MemcacheDB, Voldemort

5. DynamoDB (AWS), Dynomite, Redis and Riak

image

 

Key-Value Stores Example:

image

 

Documention Stores

1. Have “databases”, which are akin(近似) to tables

2. Have “documents”, akin to rows

  - Documents are typically JSON objects

  - Each document has properties and values

  - Values can be scalars, arrays, links to documents in other databases or sub-documents (i.e. contained JSON objects – Allows for hierarchical storage)

  - Can have attachments as well

3. Old versions are retained, so Doc Stores work well for content management

4. Some view doc stores as specialized Key-Value stores

5. Most popular with developers, startups, VCs

6. The biggies are CouchDB and MongoDB

image

 

Application Orientation

7. Documents can each be addressed by URIs

8. CouchDB supports full REST interface

9. Very geared (適應) towards JavaScript and JSON

  - Documents are JSON objects

  - CouchDB/MongoDB use JavaScript as native language

10. In CouchDB, “View functions” also have unique URIs and they return HTML. So you can build entire applications in the database

 

Document Stores Example:

image

 

CouchDB Demo 1:

image

image

image

image

image

image

 

CouchDB Demo 2:

image

image

image

image

image

 

CouchDB Demo 3:

image

image

http://127.0.0.1:5984/theNameOfDatabase/_design/example/_view/dotNet

http://127.0.0.1:5984/theNameOfDatabase/_design/example/_view/dataAccess

Result in JavaScript object

image

http://127.0.0.1:5984/theNameOfDatabase/_design/example/_show/summary/theIDOfTheDocument

Result in HTML

image

image

 

Wide Column Stores

image

image

 

Wide Column Stores Example

image

 

Graph Databases

image

image

 

Graph Databases Example

image

沒有留言:

張貼留言