Questions About Databases Flashcards
How would you migrate an application from a database to another, for example from MySQL to PostgreSQL? If you had to manage that project, which issues would you expect to face?
Why do databases treat null as a special case? For example, why does SELECT * FROM table WHERE field = null not match records with null field in SQL?
ACID is an acronym that refers to Atomicity, Consistency, Isolation and Durability, 4 properties guaranteed by a database transaction in most database engines. What do you know about this topic? Would you like to elaborate?
How would you manage database schema migrations? That is, how would you automate changes to database schema, as the application evolves, version after version?
How is lazy loading achieved? When is it useful? What are its pitfalls?
The so called “N + 1 problem” is an issue that occurs when code needs to load the children of a parent-child relationship with ORMs that have lazy-loading enabled, and that therefore issue a query for the parent record, and then one query for each child record. How to fix it?
How would you find the most expensive queries in an application?
In your opinion, is it always needed to use database normalization? When is it advisable to use denormalized databases?
Continuous Integration’s technique is called Blue-Green Deployment: it consists in having two production environments, as identical as possible, and in performing the deployment in one of them while the other one is still operating, and then in safely switching the traffic to the second one after some convenient testing. This technique becomes more complicated when the deployment includes changes to the database structure or content. I’d like to discuss this topic with you.
What is eventual consistency in NoSQL?
Brewer’s Theorem, most commonly known as the CAP theorem, states that in the presence of a network partition (the P in CAP), a system’s designer has to choose between consistency (the C in CAP) and availability (the A in CAP). Can you think about examples of CP, AP and CA systems?
How would you explain the recent rise in interest in NoSQL?
How does NoSQL tackle scalability challenges?