In the proposed E-commerce distributed database, key tables include Users, Products, Categories, Orders, OrderDetails, Transactions, Reviews, Inventory, and Shipping, each serving a distinct purpose. The Users table stores registered user information, while Products and Categories manage product details and classifications. The Orders and OrderDetails tables track user orders and their contents, and Transactions record payment details for each order. The Reviews table captures user feedback on products, Inventory manages stock levels and locations, and Shipping monitors the delivery process for orders.
The project is divided into 6 parts and there is specific directory for each part including the deliverables.
Before starting with Part 1, follow these steps to create and configure your primary database:
-
Create Primary Database:
initdb -D /tmp/primary_db/
-
Configure
postgresql.conf
for Networking:
- Edit
postgresql.conf
in/tmp/primary_db/
:- Set
listen_addresses = '*'
- Set
port = 5433
- Set
- Start the server:
pg_ctl -D /tmp/primary_db start
-
Create a Replication User:
create user repuser replication;
-
AllowRemoteAccessin
pg_hba.conf
:
- Add to
pg_hba.conf
:host all repuser 127.0.0.1/32 trust
-
Restart the PrimaryServer:
pg_ctl -D /tmp/primary_db restart
-
Configuring the Replica Server:
pg_basebackup -h localhost -U repuser --checkpoint=fast -D /tmp/replica_db/ -R --slot=some_name -C --port=5433
-
Update
postgresql.conf
in Replica Server:- In
/tmp/replica_db/
, setport = 5434
- In
-
Start Both Servers:
- Stop both servers if they are running.
- Execute
server_start.py
in the Part 1 folder.
Tools: PostgreSQL Tasks - Schema design, Table creation, Data distribution, Data insertion and retrieval. It includes an Entity-Relation diagram to represent the proposed schema, attributes, keys and constraints.
Tools: PostgreSQL Tasks - Horizontal and vertical fragmentation, Replication model
Tools: PostgreSQL Tasks - Query optimization (Analyze and optimize data retrieval), distributed indexing (query performance)
Tools: Tasks - Acid-compliant distributed transactions, concurrency control
Tools: MongoDB, Docker Tasks - Data schema, Basic CRUD operations, sample queries with data retrieval operations
https://asu.zoom.us/rec/share/XoDUKjzt76BRB4D6Ur5b86HzByoJBmTtGtGdfq0BzmwRbGVmEhVySULxTQcxZTuu.KeQtF9xsNrBzf6S- Passcode: *1hpb&Q4