Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to NoSQL Databases Tony Hannan November 2011.

Similar presentations


Presentation on theme: "Intro to NoSQL Databases Tony Hannan November 2011."— Presentation transcript:

1 Intro to NoSQL Databases Tony Hannan tony@10gen.com November 2011

2 RDBMS problem 1: Expensive joins ● Joins are not simple/fast (on single server) ● Distributed joins do not scale well (horizontally)

3 NoSQL solution 1: Non-relational (no joins) ● Queries are simpler/faster ● Simpler to distribute data

4 RDMS problem 2: Expensive transactions ● Locking and logging are not simple/fast (single server) ● Distributed transactions do not scale well

5 NoSQL solution 2: No transactions ● Updates are simpler/faster ● Simpler to distribute data

6 RDBMS problem 3: Doesn't handle network partitions ● So can only distribute across a LAN

7 NoSQL solution 3: Network partition tolerant ● Can distribute across a WAN (Cloud, Internet)

8 RDBMS problem 4: Schema duplicity ● Schema defined in two places: application (types) and database (schema) ● Schema hard to evolve

9 NoSQL solution 4: Schemaless ● Database is schemaless, i.e. dynamically typed ● Schema defined in application

10 RDBMS problem 5: Handling non-relational data ● Hard to store/query non-relational data, e.g. trees

11 NoSQL solution 5: Alternative data models ● Graph ● Document ● Wide-column ● Key-value

12 RDBMS probem 6: Language mismatch ● Need mapping layer between programming language and SQL (overhead)

13 NoSQL solution 6: API ● Query language part of client programming language

14 Summary of NoSQL advantages 1.No joins 2.No transactions 3.WAN (partition) tolerant 4.Schemaless 5.Alternative data models 6.API Scalable Programmable } }

15 NoSQL problem 1: Non-relational (no joins)

16 Solutions 1 1.Embed 2.Denormalize 3.Client-side joins 4.Graph (hyper-joins)

17 NoSQL problem 2: No transactions

18 Solutions 2: single object transaction plus... 1.Embed so transaction hits single object 2.Relax transaction requirements 3.Compensating (single object) transactions 4.Application level transaction using single object transaction as primitive for locking

19 NoSQL problem 3: Weaker consistency or availability ● When distributed across a WAN (network partitions), CAP theorem states you must give up consistency or availability 1.Eventual consistency, or 2.One half of network partition can't write (but can still read)

20 No Solution 3: Must live with... 1.Eventual consistency, or 2.Unavailable writes in one half of partition, or 3.Distribute across LAN only (no network partitions)

21 NoSQL problem 4: Schemaless lacks integrity constraints

22 Solution 4: Application ensures integrity

23 NoSQL problem 5: Non-relational model

24 Solution 5: Adapt to alternative model ● Many alternative data models map nicely to programming language data types

25 NoSQL problem 6: No query language

26 Solution 6: Learn API ● API fits with programming language better

27 Summary of NoSql disadvantages 1.Non-relational 2.No transactions 3.Eventual consistency or unwritable half when partitioned 4.No data integrity checking 5.No end-user query language

28 Some NoSQL Databases


Download ppt "Intro to NoSQL Databases Tony Hannan November 2011."

Similar presentations


Ads by Google