Untested Chapter Notes Flashcards

1
Q

CAP theory

A

Consistency
* All replicas contain the same version of data
* Client always has the same view of the data(no matter what node)

Availability
* System remains operational on failing nodes
* All clients can always read and write

Partition tolerance
* Partition tolerance means that entire clusters can still work even if a network
partition causes communication interruption between nodes.
* System remains operational on system split(communication malfunction)
* System works well across physical network partitions

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

What is Oracle RAC

A

Oracle Real Application Clusters (RAC) allow
customers to run a single Oracle Database across
multiple servers to maximize availability and enable
horizontal scalability, while accessing shared storage.

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

Sharding

A

Uses range-based partitioning to distribute documents based on a
specific shard key
* Shard key: a single indexed field for now

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

How does NoSQL differ from RDBMS?

A
  • Looser schema definition
  • Designed to handle distributed, large databases
  • Query language through the API
  • Relaxation of the ACID (Atomicity, Consistency, Isolation, Durability)
    properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL Database is horizontally scalable while NOSQL is vertically scalable T/F

A

False

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

Benefits of NoSQL

A
  • Elastic Scaling
  • DBA Specialists
  • Big Data
  • Flexible data models
  • Economics:
    - No SQL: clusters of cheap commodity servers to manage the data and transaction volumes
    • Cost per gigabyte or transaction/second for NoSQL can be lower than the cost for a RDBMS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Drawbacks of NoSQL

A
  • Support: New open source projects with startup support; no reputation
  • Maturity: still implementing their basic feature set
  • Administration: no administrator necessary however NoSQL still requires effort to maintain
  • Lack of Expertise
  • Analytics and Business Intelligence
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

MongoDB

A

Developed in C++ by 10gen founded in 2007
NoSQL database
* Hash-based, schema-less database
* No Data Definition Language
* Uses BSON format: Binary of JSON
* Supports APIs (drivers) in JavaScript, Python, Ruby, Perl, Java, C#, C++.

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

JSON

A

JavaScript Object Notation – language independent
* JSON is a lightweight format for storing and transporting data.

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

JSON Data types

A

a string, a number, an object (JSON object), an array, a boolean, a null

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

BSON

A

a binary-encoded serialization of JSON-like documents.

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

Advantages of MongoDB

A

Speed, Sharding, Flexible Database, Horizontal Scalability

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

Disadvantages of MongoDB

A

Joins not supported, limited data size

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

Applications of MongoDB

A
  • Web Content Management
  • Real-Time Analytics
  • Internet of Things (IoT)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Is MongoDB ACID compliant?

A

No

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

JSON data type cannot be a function, a date, undefined T/F

A

True

17
Q

JSON Data Structures

A

Object: Collection of name-value pairs
Array: List of values

18
Q

JSON Syntax

A

Begins with { (left brace) and Ends with }(right brace)
* Each name is followed by :(colon)
* Name/value pairs are separated by ,(comma)
* Square brackets hold arrays

19
Q

BSON – Basic types

A

Basic types:
* byte 1 byte (8-bits)
* int32 4 bytes (32-bit signed integer, two’s complement)
* int64 8 bytes (64-bit signed integer, two’s complement)
* uint64 8 bytes (64-bit unsigned integer)
* double 8 bytes (64-bit IEEE 754-2008 binary floating point)
* decimal128 16 bytes (128-bit IEEE 754-2008 decimal floating
point)

20
Q

BSON - Element - Structure - Type Selector

A
  • 0x01 = double
  • 0x10 = 4byte integer
  • 0x12 = 8byte integer
  • 0x08 = boolean
  • 0x0A = null
  • 0x09 = datetime
  • 0x11 = timestamp
21
Q

Collection and Documents MongoDB

A

Collection
* Collection of documents, usually of a similar structure
* Document
* MongoDB document = one JSON object (BSON)
* Each document has a unique idenƟfier (primary key)
* – Technically realized using a top-level _id field

22
Q

MongoDB: Object Hierarchy

A

A MongoDB database may have one or
more ‘collections’.
* A collection may have zero or more
‘documents’.
* A document may have one or more
‘fields’.

23
Q

MongoDB documents are not internally stored in BSON format and the maximum allowed size is 15 mb (t/f)

A

False

24
Q

Semi-structured model

A

is a database model where there is no
separation between the data and the schema

25
Q

Mongod (Astaghfirullah)

A

is the primary daemon process of MongoDB system. It handles data
requests, manages data access, and performs management operations.

26
Q

You can have multiple mongos for the system (T/F)

A

False, you can have one mongo for the whole system no matter how many mongods.

You also can have one local mongos for every client if you wanted to
minimize network latency.

27
Q

CRUD Operations

A

Create, read, update, delete; No data definition language (DDL) in MongoDB.
MongoDB is schemeless.

28
Q

MongoDB read operations

A

find(): primary method to select documents from a collection
* It is identical to “select * from table_name;”
* findOne(): returns only a single object

29
Q

MongoDB update operations

A

update(): corresponds to the UPDATE operation in SQL
* updateOne()
* Updating values uses the $set operator.

30
Q

MongoDB insert

A

Insert(): similar to SQL insert command
* save(): performs the same as insert()
* insertOne()
* insertMany()

31
Q

MongoDB delete

A

Remove(): similar to SQL delete
* deleteOne()
* deleteMany()
* Note: it seems that MongoDB does not have delete() function

32
Q

What does $unset do

A

deletes a particular field