database Redis

Redis代写/数据库代写/CS代写:本次作业涉及Redis代写,数据库作业代写,是典型的涉及web和数据库知识的项目
Question 1:
Note: All sub-questions for Question 2 come from the exercises in chapters 8-12, and 14 of
Database Management Systems, 3rd Edition by Raghu Ramakrishnan, Johannes Gehrke . The
questions numbers are of the form n.m, where n is the chapter number and m is the exercise
number from the end of the chapter.
1.a) Indexes

8.2.4: What is the difference between a primary index and a secondary index? What is a
duplicate data entry in an index? Can a primary index contain duplicates?

8.2.5: What is the difference between a clustered index and an unclustered index? If an index
contains data records as ‘data entries,’ can it be unclustered?

1.b) Storing Data: Disks and Files

9.4: If you have a large file that is frequently scanned sequentially, explain how you would store
the pages in the file on a disk.

9.14: Explain the term prefetching. Why is it important?

9.16: Describe two possible record formats. What are the trade-offs between them?

1.c) Tree-Structured Indexing
10.10: Consider the instance of the Students relation shown in Figure 10.30. Show the B+ of
order 2 in each of these cases (below), assuming that duplicates are handled using overflow
pages. Clearly indicate what the data entries are (i.e. do not use the k* convention).

1. A B+ tree index on age using Alternative 1 for data entries (Note: p.341, Each
tree node is a disk page, and all of the data resides in the leaf pages).

2. A dense B+ tree index on gpa using Alternative 2 for data entries. For this
question, assume that the tuples are stored in a sorted file in the order shown
in the figure: The first tuple is in page 1, slot 1; the second tuple is in page 1,
slot 2; and so on. Each page can store up to three data records. You can use
the notation (page-id, slot) to identify a tuple. (Note: p. 341, “Alternative 2 …
storing the data records in a separate file and storing (key, rid) pairs in the
leaf pages of the … index.”)

1.d) Hash-Based Indexing
Note: These are from section 11.5 Review Questions

• How does a hash-based index handle an equality query? Discuss the use of
the has function to identify a bucket to search. Given a bucket number,
explain how the record is located on disk.
• What are collisions? Why do we need overflow pages to handle them?

Question 2
Note: All sub-questions for Question 2 come from the exercises in chapters 16, 17 and 18 of
Database Management Systems, 3rd Edition by Raghu Ramakrishnan, Johannes Gehrke . The
questions numbers are of the form n.m, where n is the chapter number and m is the exercise
number from the end of the chapter.

16.2: Consider the following actions taken by transaction T1 on database objects X and Y. (Note:
For object, you can think tuple. R=read and W=write, or SELECT and UPDATE).

16.2.1: Give an example of another transaction T2 that, if run concurrently to transaction
T1 without some form of concurrency control, could interfere with T1. (Note: Use the
same notation of the form R() W().

16.2.2: Explain how 2PL would prevent interference between the two transactions.

(Note: The following questions come from 17.7 Review Questions
• What is a precedence graph or serializability graph? How is it related to
conflict serializability? How is it related to two-phase locking?
• Describe and compare deadlock detection and deadlock prevention schemes.
Why are detection schemes more commonly used?

Question 3
Note: These questions are not from textbooks. The answers come from lecture slides or lecture
slide references.
1.a) Database Connections
1. What is a database connection?
2. Why do most database connections require configuring an IP address, port
number, user id and password?
1.b) Consistency
Why is achieving strict consistency difficult and under which circumstances?
1.c) Relationships
Consider the following scenario:
• A Person has properties last_name, first_name, email.
• A Student IS_A Person and has additional property graduation_year.
• A Professor IS_A Person, and has additional property title.

You can assume all properties are strings. You should also assume that you are using Neo4J.
Draw a simple example (making up data) using nodes and arcs with labels depicting how you
represent:

1. 3 students
2. 2 professors
3. A friend relationship between two Persons.

Your diagram will use the model/convention for drawing graph data models. For example, in the
diagram above,
• Node properties are inside the circle/elipse and are of the form propertyname:
property value.
• Node Labels are in the rectangles, e.g Person, Author.
• Edges have direction, labels in capital letters and properties in the form
propertyname: value.
• You do not have to follow any specific, strict notation. Just make sure you are
clear.
1.d) Key-Value Datastores
Assuming Redis, and that you use Hash Sets for Person, Student and Professor, how would you
represent the keys for the individual entities and the relationships between them. That is, define
implement the model above using redis.
You may use the X:Y:Z convention for compound keys.
The PowerPoint diagrams from class provides some examples of how to describe your model.
Basically, you can show the individual Redis commands that you would use to create your data
in Redis.

发表评论

电子邮件地址不会被公开。 必填项已用*标注