Skip to content

Commit

Permalink
Merge pull request #28 from soat-fiap/readme_update
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
italopessoa authored Sep 25, 2024
2 parents 4e35f57 + e9a5f97 commit ea520bf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 30 deletions.
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
![Architecture Diagram](aws-infra-phase-3.png)
8 changes: 0 additions & 8 deletions init/sql/customers_table.sql

This file was deleted.

10 changes: 0 additions & 10 deletions init/sql/schema.sql
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit ea520bf

Please sign in to comment.