Lab 5: Database Design and Selecting a Primary Key

CS6650 Building Scalable Distributed Systems

Lab 5: Database Design and Selecting a Primary Key

What you should takeaway from this lab?

Operation Time Complexity
INSERT  
GET  

A simple database for our lab use.

Let’s imagine that we have a LeetCode Contest that all students in Northeastern Universtiy can participate in.

We want to record the records in a table called records:

RecordID Student ProblemID PassOrFail SubmitTime Runtime
1 Fac 111 true 11:00 12
2 Lin 222 true 12:00 17
3 Ama 222 false 11:00 17
4 Goo 333 false 12:00 12

What are the primary keys you can choose?

Please list your primary key strategies somewhere you can refer to :

Try different primary key strategies and analysis their performances and why?

Test your primary key strategies’s performance with mysqlslap

Official Documentation on mysqlslap

MySQL JSON Data Type

MySQL now supports a JSON Data Type natively. This may be something to consider for your assignment.

The effect on performaance of inserting JSON into tables is something that you may want to test using the above load generator tool approach we’ve explored above.