diff --git a/README.md b/README.md index 44a2d9f..dbefc1e 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,7 @@ This project contains the database schema and related files for the BMB applicat ├── outputs.tf ├── terraform.tfvars └── scripts/ - ├── create_tables.sql - ├── insert_data.sql - └── update_schema.sql + ├── create_table_script.sql ``` ## Dependencies @@ -38,13 +36,7 @@ terraform apply ```mermaid erDiagram - Customers { - char(36) Id - varchar(11) Cpf - varchar(100) Name - varchar(100) Email - } - + Products { char(36) Id varchar(100) Name @@ -83,12 +75,31 @@ terraform apply decimal(10) Amount } - Customers ||--o{ Orders : "has" Orders ||--|{ OrderItems : "contains" Products ||--o{ OrderItems : "included in" Orders ||--o| Payments : "paid with" ``` +## No more Customers table +The Customers table was removed from the schema as we've integrated Amazon Cognito for user management. This leverages a robust, existing solution for the generic subdomain of user/customer management. + +## Why MySql? +I've decided to use MySQL as the database for the fast-food ordering system following the reasons below: + +* **Simplicity:** + * Easy installation, configuration, and management, ideal for both the development team and the production environment. + * Familiar and widely used SQL syntax, simplifying query writing and maintenance. +* **Performance:** + * High performance for **TRANSACTIONAL OPERATIONS**, ensuring fast processing of orders and payments, even during peak hours. + * Efficient query optimization and indexing features for quick response times. +* **Reliability:** + * Data integrity features and ACID properties (Atomicity, Consistency, Isolation, Durability) guarantee information consistency and security. +* **Cost-effectiveness:** + * Open-source solution with no licensing costs, making it an affordable option for the project. + * Extensive user community and comprehensive documentation readily available online. + +* **Aurora Serverless** + - I've also chosed to use Aurora Serverless, so I can take advantage of all serverless features like no need fo managing database servers, updates, patching and of course availability andscalability ## This repo on the infrastructure -![Architecture Diagram](aws-infra-phase-3.png) \ No newline at end of file +![Architecture Diagram](aws-infra-phase-3.png) diff --git a/init/sql/customers_table.sql b/init/sql/customers_table.sql deleted file mode 100644 index f3e5637..0000000 --- a/init/sql/customers_table.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE IF NOT EXISTS Customers -( - Id char(36) not null - primary key, - Cpf varchar(11) not null, - Name varchar(100) null, - Email varchar(100) null -); \ No newline at end of file diff --git a/init/sql/schema.sql b/init/sql/schema.sql index 4580f1a..34a9116 100644 --- a/init/sql/schema.sql +++ b/init/sql/schema.sql @@ -1,15 +1,5 @@ use techchallengedb; -CREATE TABLE IF NOT EXISTS Customers -( - Id char(36) not null - primary key, - Cpf varchar(11) not null, - Name varchar(100) null, - Email varchar(100) null -); - - CREATE TABLE IF NOT EXISTS Products ( Id char(36) not null comment 'product id'