Non-Relational Database Flashcards

1
Q

What are the four data model layers ?

A

Application: objects, API’s

Storage: tables, json, xml.

Memory level: how bytes of memory are stored on disk.

Physical: bytes in terms of electrical signals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Difference between Relational data models and Document Models

A

Relational:
SQL, hide implementation details from devs. , Generalizes very well.

Document:NoSQL, Greater scalability, Specialized queries, Less restrictive than relational.

POLYGLOT PERSISTENCE: when two are used together in an architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a one-to-many relationship ?

A

Single user profile for a resume connect to multiple categories(positions, education)

Implies a tree structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a many-to-one relationship?

A

Relational:
Normalized DB IDs used for consistent style, better search.

Document:
Joins are not easy, Multiple queries needed in app code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a many-many relationship ?

A

Network:
Multiple parents, link pointers in applications, A route from root node to other items on the network, CODASYL(Conference On data System Languages)

Relational:
all data is accessible, Query optimizers automatically decide how to execute queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is the schema flexibility for document models ?

A

No enforced schema

Schema on read: Implicit schema in application code(include new columns by adding extra field)

Schema on write: Traditional relational DB schema explicit. (must migrate data into new altered table)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How is document models and memory ?

A

Document data- single continuous file.

Application- need entire file to have an advantage of less look ups.

Updates need full document to be rewritten when encoded size changes-slow updates.

HADOOP- distributed file system to store data and use it on distributed systems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How is document and relational data converged ?

A

Support for XML in most DB

JSON support in MySQL and IBM DB2

RethinkDB-supports relational-like joins.

A DB with doc like data and relational query performance would generalize better to application needs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

MapReducing querying

A

Used for processing large amount of data in bulk over many machines.

Limited form available in NoSQL like MongoDB for read only queries

Neither declarative nor fully imperative

Map:collect
REduce:fold/inject

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is the querying done ?

A

No of map tasks are given chunks of data- then processed into set of key-value pairs. Map function specifies how key-value pairs are created.

Key value pairs from each of the tasks is collected by a MASTER CONTROLLER and sorted by key. The keys are divided amongst set of REDUCE TASKS so they all with the same key are processed.

Each of the REDUCE TASKS work on one key at a time and combine values associated with that key in some way. It specifies how the key should be combined.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is graph like data models?

A

More natural to model data as a graph for many-many

It contains vertices (nodes) and edges(relationships)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Homogenous data in graph-like data models

A

Shortest path algorithms for car navigation systems

Travelling salesman to solve visiting multiple nodes in a graph over shortest path. Amazon truck.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Heterogenous data in graph-like data models

A

Provide ways of storing diff types of objects in SINGLE datastore

Facebook maintains single graph with many types of vertices and edges: Vertices:people, location, events
Edges:friendships

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is network data models

A

Each vertex:
A unique identifier, set of outgoing edges, set of incoming edges, a collection of properties.

Each edge:
A unique identifier
tail vertex
head vertex
label to describe the relationship b/w two vertices
collection of properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is cypher query language ?

A

declarative query language for property graphs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Graph queries in sql

A

Relational DB knows how many joins to make