Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 10 pages
Exam (elaborations)

NoSQL Final Exam With 100% Correct Answers

Document preview thumbnail
Preview 2 out of 10 pages

NoSQL Final Exam With 100% Correct AnswersWhat motivated the creation of NoSQL databases? - ANSWER 1) Impedance mismatch: differences between relational models and data structures used by applications that interact with databases 2) Web services: shift to web services (using HTTP) in early 2000's, need more flexibility in data structure 3) Big data: rapid data expansion -- either scale up or scale out 4) Clustered computing: RDBMS not optimized for clusters, ACID transactions degrade performance at scale How do NoSQL data models address impedance mismatch? - ANSWER Eliminate the need for object-relational mapping, simplify database interactions, and there is less code to write / maintain Store data the way you want to retrieve it Explain horizontal vs. vertical scaling - ANSWER Vertical scaling (scaling up): bigger machines, more expensive and ultimately reaches upper limits Horizontal scaling (scaling out): add more machines to cluster, cheaper at scale and more resilient and reliable General defining characteristics of NoSQL - ANSWER 1) Do not use relational model 2) Do not use SQL as query language 3) "schemaless" Page 2 of 10 4) Mostly designed for clusters 5) Usually open-source 6) specialized for specific use cases 7) Developed in early 2000's and on What is aggregate orientation? - ANSWER Related objects are grouped together and treated as one unit We communicate with the database in terms of aggregates Clusters use aggregates as units of data distribution What are the advantages of dynamic schema? - ANSWER Different records can have different structures, not as rigid In RDBMS, we must define structure a priori and take database down to make changes State the CAP theorem - ANSWER A distributed computer system cannot simultaneously provide : (1) consistency, (2) availability, and (3) partition tolerance Define consistency - ANSWER The client perceives that a set of operations has occurred all at once All clients see the same data "Atomicity" and "Consistency" from ACID Define availability - ANSWER Every request received by a non-failing node must result in a response Page 3 of 10 Every request receives a response about whether it was successful or failed If you can talk to a node in a cluster, it can read / write data Partition tolerance - ANSWER Operations will complete, even if individual machines are unavailable System can survive communication breakages in the cluster What do NoSQL database trade off in the CAP theorem? - ANSWER They sacrifice Consistency to achieve higher availability What do relational database trade off in the CAP theorem? - ANSWER They maintain high consistency at the expense of availability How is Consistency measured? - ANSWER Many kind of consistency measurements (between users, business logic, single request etc.) Measured in degrees 1) multi-table/ multi-operation ACID guarantees 2) strict consistency for single operations 3) eventual consistency 4) weak consistency Define Strong, Eventual and Weak Consistency - ANSWER Strong: All data are consistent immediately after the transaction completes Eventual: eventually all accesses to a value will return the latest version Page 4 of 10 Weak: no guarantees that system will become consistent How is availability measured? - ANSWER Typically defined as the percentage of time that the system is available Tuning consistency - ANSWER N: replication factor - how many copies will be stored W: number to write before operation is complete R: number to read during a read operation Define sharding - ANSWER Putting different data on separate nodes to improve DB performance this can also be done in RDBMS, but ACID transactions become difficult to guarantee • some support auto-sharding Define replication - ANSWER Putting multiple copies of data on separate nodes Master-slave: master can write, everyone can read • Redis, MongoDB, Neo4j Peer-to-peer: all nodes are equal and can read / write • Cassandra Explain range-based sharding and hash-based sharding - ANSWER Range-based: define a sharding key for the data-usually numeric or alphabetic, then assign chunk of memory based on the key; do this when you have a good reason Hash-based: pass shard key through hash function, that will assign the data to chunk of data What are the costs of replicating data? - ANSWER More storage required, we probably have to relax consistency guarantees for the system to be efficient at scale Page 5 of 10 Load balancing Schema changes No 'joins' / 'group by' across shards Quorum examples - ANSWER N W 1 : more than one node must participate in a write W N / 2 : no simultaneous updates W + R N : newest version of record is part of read operation Main data structure underlying key-value stores - ANSWER Hash tables, with more complex structures built on top How is data organized in key-value database? - ANSWER Values are unstructured from the point of view of the DB Various DB's can offer external means of declaring data types Use of key-value databases - ANSWER Web-session data Shopping carts User profiles Twitter (Redis)

Content preview

NoSQL Final Exam With 100% Correct Answers


What motivated the creation of NoSQL databases? - ANSWER 1) Impedance mismatch:
differences between relational models and data structures used by applications that
interact with databases



2) Web services: shift to web services (using HTTP) in early 2000's, need more flexibility
in data structure



3) Big data: rapid data expansion -- either scale up or scale out



4) Clustered computing: RDBMS not optimized for clusters, ACID transactions degrade
performance at scale



How do NoSQL data models address impedance mismatch? - ANSWER Eliminate the
need for object-relational mapping, simplify database interactions, and there is less
code to write / maintain



Store data the way you want to retrieve it



Explain horizontal vs. vertical scaling - ANSWER Vertical scaling (scaling up): bigger
machines, more expensive and ultimately reaches upper limits



Horizontal scaling (scaling out): add more machines to cluster, cheaper at scale and
more resilient and reliable



General defining characteristics of NoSQL - ANSWER 1) Do not use relational model

2) Do not use SQL as query language

3) "schemaless"
Page 1 of 10

, 4) Mostly designed for clusters

5) Usually open-source

6) specialized for specific use cases

7) Developed in early 2000's and on



What is aggregate orientation? - ANSWER Related objects are grouped together and
treated as one unit



We communicate with the database in terms of aggregates



Clusters use aggregates as units of data distribution



What are the advantages of dynamic schema? - ANSWER Different records can have
different structures, not as rigid



In RDBMS, we must define structure a priori and take database down to make changes



State the CAP theorem - ANSWER A distributed computer system cannot simultaneously
provide : (1) consistency, (2) availability, and (3) partition tolerance



Define consistency - ANSWER The client perceives that a set of operations has occurred
all at once



All clients see the same data



"Atomicity" and "Consistency" from ACID



Define availability - ANSWER Every request received by a non-failing node must result in
a response
Page 2 of 10

Document information

Uploaded on
June 24, 2025
Number of pages
10
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$18.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Onlystudents
3.9
(19)
Sold
111
Followers
86
Items
1356
Last sold
2 months ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions