Databases Flashcards
(39 cards)
One of the goals in web app development is
data persistence
Application processes stop at some point.
Reasons:
- Hardware/software failure
- Need to upgrade or replace hardware
- Need to update software
True or False
We want our application’s data to outlive the application’s process.
True
- An open-source document-based database
- A NoSQL database
MongoDB
Features of MongoDB
- High Performance
- High Availability
- Easy Scalability
Data can be stored in:
- Flat files (txt, csv, binary, etc.)
- Databases (SQL, NoSQL, Relational, Document-based, etc.)
Working with ________ is commonplace in today’s programming languages.
objects
True or False
NoSQL DBs are the same as Relational Database Management Systems in Web Applications
False
NoSQL DBs are an alternative
Schema-less collections are good for
semi-structured data
True or False
MongoDB’s speed is good for applications requiring real-time data.
True
MongoDB works with Documents in Collections.
This is analogous to ____ in Tables in Relational DBs.
Rows
Serve as the container for collections.
Databases
A MongoDB server will typically have several ________, each containing data from separate applications.
databases
- ________ contain documents, and are schema-less.
- Several documents within the same collection can have a different set of fields
Collections
Units in MongoDB collections are JSON-like objects called
Documents
Data Types
- String
- Integer
- Double
- Object
- Array
- Boolean
- Object ID
- Date
- Timestamp
- RegEx
- Undefined
- Null
- JavaScript
True or False
The object-like form of documents closely resembles native data types in many PLs.
True
In MongoDB, new documents are automatically assigned a primary key called
_id
- 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
_v
Data relationships are supported using
embedded documents or referenced documents
MongoDB commands are centered around ________, which take the form of documents/JSON
queries
MongoDB Commands
- Find
- Update
- Delete
Examples of Find
db.subjects.find({ code: “CMSC100” }) db[‘some-collection’].find({ name: “...” })
Example of Update
Update db.<collectionName>.find( <query>, <update>, <options> )
Disadvantage: Extremely large embedded documents can impact read/write performance.