13
SQL OR NOSQL Gökhan Atıl

SQL or noSQL - Oracle Cloud Day Istanbul

Embed Size (px)

Citation preview

Page 1: SQL or noSQL - Oracle Cloud Day Istanbul

SQL OR NOSQLGökhan Atıl

Page 2: SQL or noSQL - Oracle Cloud Day Istanbul

GÖKHAN ATIL

➤ Database Administrator

➤ Oracle ACE Director (2016)ACE (2011)

➤ 10g/11g and R12 OCP

➤ Founding Member and Vice President of TROUG

➤ Co-author of Expert Oracle Enterprise Manager 12c

➤ Blogger (since 2008) gokhanatil.com

➤ Twitter: @gokhanatil

2

Page 3: SQL or noSQL - Oracle Cloud Day Istanbul

WHAT IS NOSQL DATABASE?

➤ non Relational databases

➤ Not Only SQL (SQL is not mandatory)

➤ Existed before relational databases!

➤ NoSQL name is obtained after the web 2.0 wave(Amazon, Facebook, Google)

➤ Schema-less or Flexible schema

➤ Easy sharding (Horizontally Scalable)

➤ Simple API (for developers)

➤ BASE instead of ACID

3

Page 4: SQL or noSQL - Oracle Cloud Day Istanbul

CAP THEOREM

4

Page 5: SQL or noSQL - Oracle Cloud Day Istanbul

ACID BASE

➤ Atomicity: All or Nothing

➤ Consistency: The constraints won't be violated

➤ Isolation: No dirty reads

➤ Durability: Survive system failures

5

➤ Basically Available: The servers are available but the data may be stale

➤ Soft state: State of the system may change over time, even without input

➤ Eventual Consistency: The system will become consistent over time

Page 6: SQL or noSQL - Oracle Cloud Day Istanbul

NOSQL DATABASES

➤ Key/Value (KV) Store

➤ Document Store

➤ (Wide) Column Family

➤ Graph Databases

➤ Others

Object Databases

XML Databases

Multimodel Databases

6

} Different Databases

for Different

Requirements

Page 7: SQL or noSQL - Oracle Cloud Day Istanbul

KEY/VALUE (KV) STORE

➤ Collection of Key/Value pairs

➤ Inspired by Amazon's DynamoDB (now supports documents)

➤ Redis, Oracle's Berkeley DB * check my blog post

➤ Designed to handle high load

➤ In memory (cache systems)

7

Page 8: SQL or noSQL - Oracle Cloud Day Istanbul

DOCUMENT STORE

➤ Similar to Key/Value store but value is a JSON or BSON document

➤ JSON: JavaScript Object Notation, BSON: Binary JSON

➤ Inspired by Lotus Notes

➤ MongoDB, CouchDB

8

Page 9: SQL or noSQL - Oracle Cloud Day Istanbul

COLUMN FAMILY

➤ Rows do not need to contain the same columns

➤ Inspired by Google BigTable

➤ Cassandra, HBase

9

Page 10: SQL or noSQL - Oracle Cloud Day Istanbul

GRAPH DATABASE

➤ Nodes are the main data elements

➤ Nodes are connected to other nodes via relationships

➤ Neo4j, InfiniteGraph

➤ Supports ACID

10

Page 11: SQL or noSQL - Oracle Cloud Day Istanbul

11

SHOULD I USE SQL (RDBMS) OR NOSQL DATABASE?

Page 12: SQL or noSQL - Oracle Cloud Day Istanbul

ASK YOURSELF

1. Do you want to use dummy databases? No constraints, No stored procedures, and all business rules on application layer?

2. Don't you really need ACID support?

3. Do you prefer schema-less structures? What about data modelling, normalization, ETL processes, BI reports?

4. Are you sure that the feature you need is only available on NoSQL databases?

5. Scalability is important but are you ready for complex and distributed database layer?

6. Do you have required DBA resources to manage NoSQL?

7. Did you do performance tests on your NoSQL solution and compare with other solutions?

12

Page 13: SQL or noSQL - Oracle Cloud Day Istanbul

Blog: www.gokhanatil.com Twitter: @gokhanatil