JavaScript Set 9 Flashcards

1
Q

What does BSON stand for an what is it?

A

Stands for Binary JavaScript Object Notation (Binary JSON). It is a binary-encoded serialization format to represent data. Data in MongoDB is stored in BSON format for efficient storage and fast operations

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

What does it mean that MongoDB is schemaless?

A

Don’t need to configure database columns with types
No data definition language is required

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

What is the hierarchy of items in MongoDB

A

A MongoDB instance can have zero or more databases
A database can have zero or more collections
A collection can have zero or more documents
A document can have one or more fields

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

What are some facts about MongoDB documents?

A
  1. Documents in the same collection don’t have to have the same fields
  2. Documents are the same as records in RDBMS
  3. Documents can embed other documents
  4. Documents are addressed in the database with a unique key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How much faster is MongoDB than MySQL?

A

Anywhere from 2 to 10 times faster

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

What is indexing?

A

A data structure technique that allows users to quickly retrieve records from a database file. It optimizes database performance by minimizing the number of queries

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

What is an index?

A

A small table with only two columns. The first column is a copy of the primary key of a table, the second is a set of pointers that points to the address where data is saved

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

How are indexes in MongoDB defined and supported?

A

They are defined on a per collection level
They are supported on any field or sub-field within a document

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

What is sharding?

A

Distributing data across multiple servers to achieve horizontal scalability

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

What is a mongod?

A

A database instance

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

What are mongos?

A

Sharding processes. Analogous to a database router, processes all requests, decides how many and which mongods should receive the query, collates results, and sends it back to the client

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

What is mongo?

A

An interactive shell. Fully functional JavaScript environment for use with MongoDB

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

How many mongos do you need for a system?

A

You can have one mongos for the whole system no matter how many mongods you have. Or, you can have one local mongos for every client to minimize network latency

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

What are the limitations of MongoDB?

A
  1. No referential integrity
  2. Updating something in many places instead of one because of horizontal scalability
  3. Lack of a predefined schema meaning objects in a collection can be completely inconsisten
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does having no referential integrity mean?

A

Referential integrity is the relationship between tables which is managed in RDBMS by primary and foreign keys. MongoDB does not have this

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

How do you start and connect to mongo?

A
  1. Create an empty folder to contain the database files
  2. Start the mongo server
    mongod.exe –dbpath c:\data\db (or other path)
  3. In a separate terminal, run the mongo client shell to access the database
    mongo.exe