Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Database Design for NoSQL Systems

No description
by

Obaida Hanteer

on 21 September 2015

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Database Design for NoSQL Systems

Database Design for NoSQL Systems
Relational DB Desgin
vs
NoSQL Design

Database design for NoSQL Systems
The NoAM Abstract Data Model
Example (online game)
1- Conceptual modeling (ERD)
What About Graph databases ?
NoSQL Databases Types
Database Design for
NoSQL
Systems

Key-Value Database
Document Databases
Column Family Databases
Graph Databases
BigTable Style
Relational DB modeling
NoSQL DB modeling
(NoAM)
Requirements
Conceptual model (ERD)
Queries to perform
Requirements
Used NoSQL System
NoSQL Model
Queries to perform
Requirements
NoSQL Abract Model NoAM
The methodology is based on the following main activities :
Conceptual data modeling
Aggregate design
Aggregate partitioning
High level NoSQL database
design (NoAM)
Collection1
Collection2
Collection3
Block1
Block2
Block3
Block1
Block2
Block3
Block1
Block2
Block3
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
ek
ev
Data access unit
Distribution unit
entry
Ability to access the
data unit
Player
Game
id : int
userName : str
FirstName : str
LastName : str
Score:int
Round
Move
Name : str
Plays
id : int
id : int
Has
1 .. *
1 .. *
1 .. *
Example (online game)
1- Conceptual modeling ( Some objects )
Has
rick: Player
2345: Game
mary: Player
username = "mary"
firstName = "mary"

lastName = "Wilson"
username = "Rick"
firstName = "Rick"

lastName = "Doe"
score : 42
id = 2345
:Round
:Move
:GameInfo
2345: Game
:Round
:Move
:Move
:GameInfo
:GameInfo
:GameInfo
opponent
opponent
:GameInfo
First player
Second player
Example (online game)
2- Aggregate design
rick: Player
2345: Game
mary: Player
username = "mary"
firstName = "mary"

lastName = "Wilson"
username = "Rick"
firstName = "Rick"

lastName = "Doe"
score : 42
id = 2345
:Round
:Move
:GameInfo
:Round
:Move
:Move
:GameInfo
:GameInfo
:GameInfo
opponent
opponent
:GameInfo
First player
Second player
Later Each aggregate will be mapped to a NoAM block
Has
1 .. 1
1 .. *
1 .. 1
Driven by :
- Data access operations
- Consistency needs
Implementation
Oracle NoSQL
Experimental results
Game
Player
2345
1234
3456
Player info
Games Info
First player
Second player
Player info
Games Info
Rounds
{
Moves {}
}
Example (online game)
3- Data representation in NoSQL Aggregate partitioning
Aggregate class
Collection
Aggregate instance
Block
Aggregate value
Set of entries
Aggregate level
NoAM level
How to store the value ?
Aggregate Partitioning
EOA
ETF
Entry Per Aggrgate Object (EAO)
Entry per Top level Filed (ETF)
- Single entry for each aggregate object
- The entry key is empty
- The entry value is the whole complex value of the aggragate
Game
2345
$
<id:"2345",
first player : Player :Mary ,
second player : Player :Rock,
rounds : {
<moves : ....,comments, .... :>,
<moves : ...,actions : ...,spell,... : ..>
} >
- Single entry for each top level field
- The entry key is the name of the top level field
- The entry value is the field value
Game
2345
Aggregate partitionaing :
-Aggregate is small => EAO
-Aggregate is large => Partitioning
Second player
Rounds
First player
id
2345
Player: mary
Player: rock
{
<moves : ....,comments, .... :>,
<moves : ...,actions : ...,spell,... : ..>
}
elements that are reached together forms one entry
elements that are reached seprately belongs to different entries
Game
2345
Rounds[1]

<moves : ....,comments, .... :>,


Obaida Hanteer
Software Engineer, Aleppo University, Syria
Master in Computer science , Sapienza university , Rome
Rounds[0]

<moves : ...,actions : ...,spell,... : ..>

< id: 23445,
firstPlyer : player:mary,
secondPlayer : player:Rock
>
$
MongoDB
DynamoDB
Game
2345
Rounds[1]

<moves : ....,comments, .... :>,


Rounds[0]

<moves : ...,actions : ...,spell,... : ..>

< id: 23445,
firstPlyer : player:mary,
secondPlayer : player:Rock
>
$
(key-value store)
- Structured key ( major key /-/ minor key )
- Each entry <ek,ev> in the NoAM is interpreted into key-value pair.
Major key = collection name/block id
Minor key = proper coding of the entry code
- The above example can be implemented as it follows :
Game/2345/-
Key
Value
{id=2345,firstPlayer : player:mary ...}
Game/2345/- /round[0]

{moves : ...,actions : ...,spell,... : ..}

Game/2345/- /round[1]

{moves : ....,comments, .... :}


(Document store)
(Column family store)
Implementation with Oracle NoSQL
Implementation with Dynamo DB
- Each collection is a table, and each block is a row in this table.
- Collection name is usd as a table name.
- Block id is used as a primary key in that table.
- Block entreis are used as (attribute,value) pairs.
Table : Game
id
$
round[0]
round[1]
2345
{id=2345,firstPlayer : player:mary ...}

{moves : ...,actions : ...,spell,... : ..}


{moves : ....,comments, .... :}


- Collection name is used as a MongoDB collection name
- Block id is used as a special top-level id field
- Each entry is used as a possuble nested value in this document.
2345
{ _id: "2345"
$ : { id: 2345, firstPlayer: player:mary ..}
round[0]: {.......comments:.............},
round[1]:{ ..................................}
}

id
document
Implementation with Mongo DB
No Systematic methodolgy
Full transcript