Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Fall 2022 CS157C: NoSQL Database Systems

Assignment 1

 

Due: Saturday, September 10 11:59 pm:

Save your answers in hw1.txt and zip it into hw1.zip.

Submit hw1.zip through the course web site.

1. Compare the consistency of ACID properties to that of the CAP theorem.

2. Explain trade-off between isolation level and latency in relational database systems.

3. Writes on databases are first done in memory and then persisted in the disk. This principle is applied to the process of writing data as well as that of writing corresponding logs. Consider this principle to answer this  question.

Explain how a database system handles writes (e.g. Update X with Y)in terms of the following actions:

- The log entry of this update is written in the memory.

- Data is updated in memory.

- The log entry is persisted on disk.

- Updated data is persisted on disk.

4. Explain why JDBC is not considered object-oriented.

5. Compare hash partitioning and range partitioning of NoSQL database systems.

6. Explain schema-on-read and schema-on-write along with one example of a database system for each.

7. What is the main difference between key-value stores and document stores? How does this difference affect the ability of the database to query data and to create an index?

8. Column-oriented databases are often deployed to support OLAP applications. Present an example SQL query based on a star-schema and explain how a column-oriented database can efficiently support this query.

9. Explain the trade-off between consistency level and availablity of distributed database systems in the context of CAP theorem.

10. Select a NoSQL database system of your choice that follows the aggregate data model. Answer the following questions specific to the system you selected. Exclude MongoDB and Cassandra from your choice.

1. Explain its data model.

2. Explain the unit of sharding (partitioning) and replication of the system.

3. Is there any index created by the database by default? Briefly explain it.

11. In your laptop, setup MongoDB in a single node using Ubuntu Docker image. The following instructions are posted under Course Materials section to assist you.

  Setting up Docker and GIT on Mac

  Setting up Docker and GIT on Windows

  Setting up Docker on an old version of Windows

  MongoDB Single Node Setup in a Ubuntu Docker Container

Run mongosh on the ubundu container prompt and coy and paste the initial screen into hw1.txt. The initial screen should look like this:

root@a4d58ec0993d:/# mongosh

Current Mongosh Log ID : 6200b48e3efc8dd8aeefcfc6

Connecting to :           mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.1.9

Using MongoDB :           5.0.5

Using Mongosh :           1.1.9

For mongosh info see : https://docs.mongodb.com/mongodb-shell/