Worked example 1
A new online shop is being developed. The developers are considering storing customer orders in simple CSV files. Explain three reasons why using a DBMS would be a more suitable solution, referencing specific DBMS features.
Show solution outline
Using a DBMS is far more suitable for an online shop. Here are three key reasons:
- Concurrency Control: Multiple customers may try to buy the last item in stock simultaneously. A CSV file system cannot manage this; it could lead to overselling the item. A DBMS uses concurrency control (e.g., record locking) to ensure that only one transaction can complete the purchase of the last item, preventing data inconsistency and customer dissatisfaction. [1 mark]
- Data Integrity: The DBMS can enforce rules to ensure data quality. For example, it can ensure that every OrderID in the OrderItems table corresponds to a valid OrderID in the Orders table (referential integrity). It can also validate data types, ensuring a price is always a number. A simple CSV file offers no such built-in validation, risking data corruption. [1 mark]
- Security and Access Control: The online shop's database will contain sensitive customer information. A DBMS provides robust security features through its DCL, allowing the creation of different user roles. For instance, a customer service agent might only have read-only access to order history, while an administrator has full rights. This level of granular security is not possible with a simple file system, which would be a major security risk. [1 mark]