Databases Flashcards

(39 cards)

1
Q

One of the goals in web app development is

A

data persistence

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

Application processes stop at some point.
Reasons:

A
  • Hardware/software failure
  • Need to upgrade or replace hardware
  • Need to update software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or False

We want our application’s data to outlive the application’s process.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  • An open-source document-based database
  • A NoSQL database
A

MongoDB

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

Features of MongoDB

A
  • High Performance
  • High Availability
  • Easy Scalability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Data can be stored in:

A
  • Flat files (txt, csv, binary, etc.)
  • Databases (SQL, NoSQL, Relational, Document-based, etc.)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Working with ________ is commonplace in today’s programming languages.

A

objects

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

True or False

NoSQL DBs are the same as Relational Database Management Systems in Web Applications

A

False

NoSQL DBs are an alternative

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

Schema-less collections are good for

A

semi-structured data

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

True or False

MongoDB’s speed is good for applications requiring real-time data.

A

True

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

MongoDB works with Documents in Collections.
This is analogous to ____ in Tables in Relational DBs.

A

Rows

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

Serve as the container for collections.

A

Databases

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

A MongoDB server will typically have several ________, each containing data from separate applications.

A

databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  • ________ contain documents, and are schema-less.
  • Several documents within the same collection can have a different set of fields
A

Collections

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

Units in MongoDB collections are JSON-like objects called

A

Documents

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

Data Types

A
  • String
  • Integer
  • Double
  • Object
  • Array
  • Boolean
  • Object ID
  • Date
  • Timestamp
  • RegEx
  • Undefined
  • Null
  • JavaScript
17
Q

True or False

The object-like form of documents closely resembles native data types in many PLs.

18
Q

In MongoDB, new documents are automatically assigned a primary key called

19
Q
  • In version 3+ of MongoDB there is also a generated version key ___
  • It is incremented after the execution of certain functions such as save or findOneAndUpdate
20
Q

Data relationships are supported using

A

embedded documents or referenced documents

21
Q

MongoDB commands are centered around ________, which take the form of documents/JSON

22
Q

MongoDB Commands

A
  • Find
  • Update
  • Delete
23
Q

Examples of Find

A
db.subjects.find({ code: “CMSC100” })
db[‘some-collection’].find({ name: “...” })
24
Q

Example of Update

A
Update
db.<collectionName>.find(
<query>,
<update>,
<options>
)
25
Example of Remove
`db..remove()`
26
_\_\_\_\_\_\_\_ documents keep related data together.
Embedded
27
Advantage and Disadvantage of Embedded Documents
Advantage: Keeping related data in a single document makes it easy to query and update.
Disadvantage: Extremely large embedded documents can impact read/write performance.
28
_\_\_\_\_\_\_\_ documents take a normalized approach similar to Relational DBs. _\_\_\_\_\_\_\_ documents exist in their own collection. | Same Answer
Referenced
29
Documents in other collections may reference them using an Object ID (or any identifying field).
Referenced Documents
30
Advantages of Referenced Documents
1. Multiple documents can refer to the same external document. 2. Avoids the pitfalls of excessively large embedded documents.
31
Disadvantage of Referenced Documents
Requires additional querying that many developers want to avoid.
32
# Features of MongoDB - High Performance Support for embedded documents _\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ and multi-document queries on the database.
reduces need for joins
33
# Features of MongoDB - High Availability MongoDB supports _\_\_\_\_\_\_\_\_\_\_\_, which provide redundancy.
Replica Sets
34
# Features of MongoDB - Scalability MongoDB supports _\_\_\_\_\_\_\_: Distribution of data across several machines.
Sharding
35
Terms
Table --------------------- Table Relational -------- No SQL Database -------- Database Table -------------- Collection Row --------------- Document Column ---------- Field Table Join -------- Embedded Document Primary Key ----- Primary Key
36
* Before you can use data stored in databases, you have to convert it to a data structure your PL can understand. * This goes for any kind data manipulation: creating, updating, and deleting data. * Thus, the need for _\_\_\_\_\_\_\_\_\_\_\_
Object Relational/Document Mapping
37
Refers to the process of converting data between systems of incompatible data types, using object-oriented methods.
Object Relational Mapping
38
_\_\_\_\_\_\_\_\_\_\_\_ is the equivalent term for NoSQL / Document-based databases.
Object Document Mapping
39
Advantages of using ORD/ORM
1. In-depth knowledge of the DB is not required for application development. 2. DB querying optimization is independent from business logic. 3. Underlying DB Technology can easily be changed There are minimal disadvantages to using ORM. Just be sure to use one that is being maintained.