01 nosql and multi model database

40
اﻟﺗﻘﻧﯾﺔ اﻟﺧﻠﯾل ﻟﻘﺎءاتHebron Tech Meetup

Upload: mahdi-atawneh

Post on 16-Apr-2017

885 views

Category:

Education


4 download

TRANSCRIPT

Page 1: 01   nosql and multi model database

لقاءات الخلیل التقنیةHebron Tech Meetup

Page 2: 01   nosql and multi model database

Multi-model NoSQL database

Hebron Tech Meetup / 13-02-2016

Page 3: 01   nosql and multi model database

TopicsThis is slides is presented at “Hebron Tech meetup “ https://www.facebook.com/groups/659298460875650/

1- What is nosql?

Introduction about nosql database , categories of them , and use-cases .

2- introduction to multi-model database.

how it works, explain relationships , and examples.

3- Demo

Open your browser and get you hands dirty with orientDb

This template is free to use under Creative Commons Attribution license. If you use the graphic assets (photos, icons and typographies) provided with this presentation you must keep the Credits slide.

Page 4: 01   nosql and multi model database

Hello!I am Mahdi AtawnaI am here because I love to give presentations.

You can find me at:

@mshanak

Page 5: 01   nosql and multi model database

1.What is NOSQL

introduction about NOSQL types and use-casesBY: Shadi atawna

Page 6: 01   nosql and multi model database

What is Problem of RDBMS?

▷ Schemas aren’t designed for Sparse data.▷ Normalize, creates a lot of tables .▷ Joins can be prohibitively expensive

Page 7: 01   nosql and multi model database

What is Problem of RDBMS?

▷ Don’t do unstructured data search well (i.e. google type searching)

▷ databases are simply not designed to be distributed○ Don’t Scale well.

○ clustering is not dynamic and expensive.

Page 8: 01   nosql and multi model database
Page 9: 01   nosql and multi model database

▷ Class of non-relational data storage systems

▷ Running well on clusters (distributed)▷ Mostly open-source▷ Built for the 21st century web needs .▷ Schema-less

What is NoSQL?

Page 10: 01   nosql and multi model database

Why NoSQL?

1. Big Users2. Big Data3. The Internet of things4. The Cloud Computing5. Scalability and Performance Advantages6. Flexible Data Model

Page 11: 01   nosql and multi model database

Types/Models of NoSQL:

1. Key value Databases2. Document Databases3. Column family Stores4. Graph Databases

Page 12: 01   nosql and multi model database

Types/Models of NoSQL:

1. Key value Databases2. Document Databases3. Column family Stores4. Graph Databases

Page 13: 01   nosql and multi model database

1Document Databases

a computer program designed for storing, retrieving, and managing document-oriented information, also known as semi-structured data.

Page 14: 01   nosql and multi model database

Document Databases

Page 15: 01   nosql and multi model database

Document Databases Example

Page 16: 01   nosql and multi model database

Document DatabasesFeatures:

1. Making the value visible for query2. Flexible schema3. Semi-Structured.

Limitations:

1. not handling transaction on multiple document.

Use Cases:

1. event logging2. Content management systems, blogging platforms

Page 17: 01   nosql and multi model database

2Graph Databases

a database that uses graph structures for semantic queries with nodes, edges and properties to represent and store data.

Page 18: 01   nosql and multi model database
Page 19: 01   nosql and multi model database

Graph vs RDBMS

A Graph Database creates the relationship just once (when the edge is created)

VS

RDBMS computes the relationship every time you query a database

Page 20: 01   nosql and multi model database

App with many databases

Page 21: 01   nosql and multi model database

2.Multi-model database

Page 22: 01   nosql and multi model database

“A multi-model database combines a

document store with a graph database and is at the same time a

key/value store,

Page 23: 01   nosql and multi model database

Page 24: 01   nosql and multi model database
Page 25: 01   nosql and multi model database

Benefits

1. Just one product to learn and maintain2. Just one vendor relationship to manage3. No ETL, no synchronization required4. Performance and Reliability is easy to test

from the beginning

Page 26: 01   nosql and multi model database

graph example

Page 27: 01   nosql and multi model database
Page 28: 01   nosql and multi model database

Popular multi-model databases

http://orientdb.com/orientdb/ https://www.arangodb.com/

Page 29: 01   nosql and multi model database

OrientDb: Queries

Orient DB uses SQL as it's query language and adds some extensions to enable graph functionality.

1. SQL is the mostly widely recognized standard.2. The majority of developers have experience and

are comfortable with SQL

Page 30: 01   nosql and multi model database

OrientDb: Select

Page 31: 01   nosql and multi model database

OrientDb: query examples

> SELECT FROM MyClass WHERE id = 1

> SELECT FROM User WHERE name LIKE 'mahdi%'

> SELECT SUM(salary) FROM Employee WHERE age < 40 GROUP BY job

Page 32: 01   nosql and multi model database

OrientDb: INSERT

> INSERT INTO Employee(name, surname, gender) VALUES ('Jay', 'Miner', 'M')

> INSERT INTO Employee CONTENT { name : 'Jay',

surname : 'Miner', gender : 'M'

}

Page 33: 01   nosql and multi model database

OrientDb: JoinsSQL:SELECT *FROM Employee A, City BWHERE A.city = B.idAND B.name = 'Rome'

OrientDb:SELECT * FROM Employee WHERE city.name = 'Rome'

Page 34: 01   nosql and multi model database
Page 35: 01   nosql and multi model database

OrientDb: Create Relations

CREATE EDGE FROM #10:3 TO #11:4

CREATE EDGE friends FROM #10:3 TO #11:4

Page 36: 01   nosql and multi model database

OrientDb: Query Relations/ TRAVERSE

TRAVERSE * FROM #10:1234

TRAVERSE friends FROM #10:1234 WHILE $depth <= 3

TRAVERSE in(“friends”) FROM #10:1234 WHILE $depth <= 3

Page 37: 01   nosql and multi model database

Query Relations - TRAVERSE

SELECT FROM (TRAVERSE friends FROM #10:1234 )

WHERE city = 'Rome'

-----------------------select from

( traverse in("livedIn") from #15:2 ) where @class="teacher"

Page 38: 01   nosql and multi model database

3.Demo

Page 39: 01   nosql and multi model database

Thanks!Any questions?You can find me at:

@mshanak

[email protected]

Page 40: 01   nosql and multi model database

Credits

Special thanks to all the people who made and released these awesome resources for free:

▷ Presentation template by SlidesCarnival▷ Photographs by Unsplash