E-commerce Database System Design Guide
E-commerce Database System Design Guide
The proposed system implements several relational database constraints to maintain data integrity. Each user can create only one shop, ensuring unique shop-user ownership. Each cart belongs to a single user, linking shopping activity to individual clients. Products must be linked to a shop, maintaining product origin consistency. Reviews are restricted to products that users have purchased, ensuring authentic feedback. Orders must contain at least one product, confirming valid transactions. Discounts are applied only if conditions are met, safeguarding promotional usage. Each order can have only one payment record, ensuring financial transaction clarity. These constraints ensure system operations reflect real-world business logic and uphold data coherence .
The proposed system's approach in handling discount application and tracking is highly effective. It uses the Discounts and OrderDiscounts tables to manage the application of promotions and maintain a record of usage history. By linking orders directly with applicable discounts through OrderDiscounts, the system ensures that discounts are only applied when eligibility conditions are met. This method effectively prevents misuse of promotions and allows for retrospective analysis of discount application trends, contributing to informed strategic decisions by sellers and system administrators .
Categorizing products hierarchically in the e-commerce system helps in organizing products into logical groups, enhancing the searchability and discoverability for buyers. This model is implemented in the database schema through a recursive relationship managed by a ParentID, which serves as a foreign key referencing CategoryID. This structure enables products to be sorted and displayed in hierarchical formats, improving navigation and user experience .
The proposed system handles the e-commerce transaction lifecycle by allowing buyers to search for products, which can be organized by categories or found using the search bar. Buyers add desired items to their cart and proceed to checkout, choosing shipping and payment methods. Once the order is confirmed, buyers can track the status until delivery. Post-purchase, buyers are able to submit reviews, providing feedback and ratings based only on purchases made. This complete lifecycle management is supported by a comprehensive backend system built on proper entity and relationship mapping .
Semantic constraint enforcement in the proposed e-commerce platform ensures that the system accurately reflects business logic and real-world scenarios. Constraints such as limiting users to one shop, requiring every product to belong to a shop, or restricting review writing to verified purchasers, ensure logical data relations and prevent erroneous entries. This enforcement is achieved through a combination of schema design, with primary and foreign keys, unique constraints, and application-level logic that governs user actions to maintain consistency and prevent data anomalies .
The many-to-many relationship between Orders and Discounts is managed through an intersection table called OrderDiscounts. This table tracks the promotion usage history by linking orders with applicable discounts. Using this approach allows for efficient management of multiple discounts applied to multiple orders, facilitating robust querying and maintaining referential integrity between entities within the relational database system .
Administrators play a critical role in ensuring the system's data validity and operational integrity. They oversee the entire system, manage complaints and user issues, and enforce policies to maintain data accuracy. Specific functions include user account management, approving or rejecting product listings, auditing system logs, and responding to security alerts. This role is crucial in ensuring that the system operates smoothly and user data is correctly managed and protected .
Shopee utilizes a hybrid business model of B2C (Business to Customer) and C2C (Customer to Customer), acting as an intermediary to connect buyers and sellers. It supports users by providing services to ensure that transactions are safe and convenient. For buyers, Shopee offers features like product search, shopping cart management, order tracking, and review submission. Sellers manage their shop accounts, products, and orders while benefiting from promotional tools provided by Shopee. This comprehensive approach ensures a smooth transactional process for both parties .
The proposed e-commerce system manages three main user roles: Buyers, Sellers, and Administrators. Buyers can search for products, purchase them, manage shopping carts, and write reviews. Sellers manage their shops and products and handle customer orders. Administrators oversee the entire system, manage complaints, users, and ensure data integrity. Key functionalities include user account management, product and order management, review systems, and support for multiple payment methods .
The relationship between a buyer's actions and order processing is intricately reflected in the database schema through several tables and their interactions. Buyers use the Cart table to hold selected products, which is later converted into entries in the Orders and OrderItems tables representing the finalized purchase. The Orders table captures overall order details like status and total value, while the OrderItems table records specific product details, quantity, and pricing. These relationships ensure every buyer action from selection to purchase is systematically captured and processed to ensure data integrity and alignment with real-world shopping behavior .