nosql databases oracle - berkeley db. content a brief intro to nosql about berkeley db about our...

38
NoSQL Databases Oracle - Berkeley DB

Upload: peregrine-chapman

Post on 31-Dec-2015

225 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

NoSQL Databases

Oracle - Berkeley DB

Page 2: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Content

A brief intro to NoSQL

About Berkeley Db

About our application

Page 3: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

3

???

Page 4: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

What is NoSQL?

• Stands for Not Only SQL

• Class of non-relational data storage systems

• Usually do not require a fixed table schema nor do they use the concept of joins, group by, order by and so on.

• All NoSQL offerings relax one or more of the ACID properties.

Page 5: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

What is NoSQL ?

• Next generation databases

• Characteristic:

– Large Data Volumes

– Non-relational

– Distributed

– Open-source

– Scalable replication and distribution

Page 6: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

CAP Theorem

Page 7: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

8

History of NoSQL

• The term NoSQL was introduced by Carl Strozzi in 1998 to name his file based database.

• It was again re-introduced by Eric Evans when an event was organized to discuss open source distributed databases.

Page 8: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Why NoSQL Databases ?

• Bigness

• Massive write performance

• Fast key-value access

• Flexible schema and Flexible data types

• No single point of failure

• Programming ease of use

Page 9: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 10: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 11: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

12

Scaling to size vs complexity.

Page 12: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 13: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 14: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Berkeley DB - Introduction

• An open-source, embedded transactional data management system.

• A key/value store.

• Runs on everything from cell phone to large servers.

• Distributed as a library that can be linked directly into an application.

• Berkeley DB has high reliability and high performance.

Page 15: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Berkeley DB Product Family Architecture

Page 16: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Berkeley DB: The Design Philosophy

• Provide mechanisms without specifying policies.

• For example, Berkeley DB is abstracted as a store of <key, value> pairs.

– Both keys and values are opaque byte-strings.

– Berkeley DB has no schema.

– Application that embeds Berkeley DB is responsible for imposing its own schema on the data.

Page 17: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Data Access Services

• Indexing methods

– B-Tree

– Hash

– Queue

– A record-number-based index

Page 18: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Advantages of <key, value> pairs

• An application is free to store data in whatever form is most natural to it.

– Objects (like structures in C language)

– Rows in Oracle, SQL Server

– Columns in C-store

• Different data formats can be stored in the same databases.

Page 19: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Data Management Services

Concurrency

Transactions

Recovery

Page 20: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Berkeley DB Applications

• Local Directory Access Protocol

• Mail Servers

• Manage access control lists

• Store user keys in a public-infrastructure

• Record machine-to-network address mappings in address servers

Page 21: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 22: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 23: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 24: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Berkeley DB for Computationally Intensive

Algorithms• Algorithms that repeatedly execute a

computationally intensive operation– E.g. Factorial

• Useful to create a cache containing the already computed results– Cache = Set of <key,value> pairs containing <n,

factorial(n)>

• Advantages:– avoid to re-compute results for the same input (even

over different executions) – In a process crash, we can still start again the process

and quickly go back to the point where it stopped

Page 25: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

• In memory map• Simple• Very efficient (b/s in completely memory)• Need considerable amount of memory• No fault tolerance (We need to manually save data to a file)• Relation Databases• ACID properties may not be necessary• Cannot handle Big data • Slow• NoSQL databases (Berkeley DB)• Fast key-value access• Flexible schema and Flexible data types• Ease of use• Fault tolerance

Page 26: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Berkeleydb.java

Page 27: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

• Open Environment:• EnvironmentConfig class specify environment configuration parameters

• Open Class Catalog: • Class catalog : specialized database store that contain

java class descriptions of all serialized objects stored in the database

• Create Database and StoredClassCatalog object

Page 28: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 29: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

• Open Database:

• Close Environment, Class Catalog and Databases:

Page 30: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

DBViews.java

Page 31: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Factorial.java

Page 32: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 33: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 34: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 35: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application
Page 36: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Factorial (Berkeley DB ) – Memory Usage

Page 37: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Factorial (MySQL) – Memory Usage

Page 38: NoSQL Databases Oracle - Berkeley DB. Content A brief intro to NoSQL About Berkeley Db About our application

Factorial (HashMap) – Memory Usage