You are developing a system with stringent data integrity requirements. How would you design the schema to enforce data integrity constraints and handle violations effectively?
- Use database triggers to enforce constraints.
- Implement application-level validation only.
- Apply foreign key constraints to maintain data relationships.
- Rely solely on user input validation.
Option (1) is a valid approach using database triggers to enforce constraints. Option (2) shouldn't be the sole method, as application-level validation can be bypassed. Option (3) is essential, especially for maintaining data relationships. Option (4) is not sufficient for ensuring data integrity on its own.
Loading...
Related Quiz
- How can closures be utilized effectively for asynchronous programming in JavaScript?
- How can you send JSON data as a response using the http module in Node.js?
- How does indexing impact the performance of read and write operations in a database?
- The prototype of an instance object in JavaScript is found using the ______ property.
- In Node.js, a '______' event is emitted by a readable stream when there is no more data to read.