DS 220 Midterm 1. (a) You declared a table phone-num and (b) nu customers who wa
ID: 3733896 • Letter: D
Question
DS 220 Midterm 1. (a) You declared a table phone-num and (b) nu customers who want to use three phone numbers in their account settings. whtomers who watable with one phone-number column. Now, you have what do you do if you have the data stored in (a) relational datà and addresses of n so that you can document database such as MongoDB? (b) You want to enable atomic updates to phone numbers users in MongoDB. What should you do in your desig support that? (c) What is eventual consistency? What is the advantage of having even consistency? (d) Your most frequent query is as follows: "Return all comments made in response to comment#, posted by a student". Show how you would store your data and what you would index using which type of indexing (B+-tree or hash tree)? 2. (a) Provide three clear examples using two transactions, the statements of the two transactions, and a timing diagram to show a write-write conflict, a read-write conflict, and a write-read conflict where the result is not equal to a serializable schedule. Show the initial value of the data and the final in the three cases. (b) Data warehouses use denormalized schema design. Show a small example that uses a denormalized schema. What are the advantages and disadvantages of denormalization? (c) What does information gain capture? When do you stop expanding a branch in a decision tree? (d) Consider the database D depicted in Table 1, containing five transactions, each containing several items. Consider minsup-60% and minconf-S096, Table i : Database D of transactions to be analyzed. TiD ltems T100 {B, O, N, E, C, O} T200 (B, O, N, E, C, A) T300 (C, A, N, E, C, A) T400 (F, A, N, E, C, A) T500 (F, A, C, A) Find all frequent 4-itemsets and 3-itemsets in the database. (i) (ii) Find association rules from these itemsets that satisfy the support and confidence thresholds stated above. (e) For what type of problems do you enable replication and for which do you enable sharding? Identify situations when replication and sharding can reduce downtime (state two scenarios, one for each). (f) When do you use a relational database, a key-value database, and a document database? Clearly identify the characteristics of the data, schema, and queries that you will consider to make such a choice. 3. (a) What is the difference between ACID and BASE? (b) What is a journal in MongoDB? Why do we need it?Explanation / Answer
3 a) What is the difference between ACID and BASE?
ACID:
In simple words An acid is any chemical compound. Acid can dissolve in water and it can also give us a solution with a hydrogen ion activity which is very greater than in pure water.
The ionic compounds which breaks apart in water to form a hydrogen ion (H+) is know as ACIDS.
Acids are also known as corrosive substances.
The Characteristics of Acids are they taste like a sour when they are eaten and they can turn blue litmus paper red.
The acids are mainly used in the lads to study chemistry and biology.
Acids can be classified into strong acids extremely and formic acid and acetic acid are the some of the concentrated weak acids.
BASE:
A base is an aqueous substance which can accept hydrogen ions and Bases are also known as corrosive substances.
The Characteristics of Bases are they taste like some Bitter and they always opposes to sour taste of acids.
And with help of the base we can feel soapy on our fingers and there are many bases react with acids and it can also precipitate the salts.
And also with help of the Strong bases we can make huge reactions with acids.
The Bases can also turn red litmus paper blue and the Bases are soluble in water
3 b) What is a journal in MongoDB? why we need it?
The journal in MongoDB is a process in which the write operations will takes places and occurs in mongod and it will create the view privatly. There we are having two blocks in which first block is known as memory block and the second block is known as disc.
So after some time while we are commiting we can also say as journel commit interval. The views which are privatly saved will write the operations in directory called journel directory which will be residing in the second block disc.
So we have known that once we have committed the journel commit the mongodb push the data into a view called as shared view. So it gets written to directory called actaul data directory from the shared view.
So in this situation or a scenario we can have problem at any point of time. We can also think that the disc will be unavailable. So when the mongodb starts the write operations will takes place and the logs and data will be saved into the actual directory.
We can also make some cycle in time in order to reduce the cycle from 60secs to 200 msecs. so that we can make a note of readings and make assumsions.
Note: According to the chegg rules i have answered only one question. For remaining questions to be answered please post them in saperate post. Thank you for your understandings.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.