{"id":22096636,"url":"https://github.com/soat-fiap/bmb.database","last_synced_at":"2026-05-09T00:39:07.560Z","repository":{"id":255588686,"uuid":"833181166","full_name":"soat-fiap/bmb.database","owner":"soat-fiap","description":"Manages the database schema and related files for the BMB application. It includes SQL scripts for creating tables, inserting data, and updating the schema, along with Terraform configurations to manage the database infrastructure, ensuring consistency and ease of deployment.","archived":false,"fork":false,"pushed_at":"2024-12-04T13:41:20.000Z","size":758,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T07:31:20.458Z","etag":null,"topics":["aws","aws-aurora","fiap","sql","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soat-fiap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-24T14:09:33.000Z","updated_at":"2024-11-28T15:55:10.000Z","dependencies_parsed_at":"2024-11-15T03:23:37.226Z","dependency_job_id":"4e37ffaf-9d9b-474e-91ba-d08b9688cd87","html_url":"https://github.com/soat-fiap/bmb.database","commit_stats":null,"previous_names":["soat-fiap/bmb.database"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soat-fiap%2Fbmb.database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soat-fiap%2Fbmb.database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soat-fiap%2Fbmb.database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soat-fiap%2Fbmb.database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soat-fiap","download_url":"https://codeload.github.com/soat-fiap/bmb.database/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191590,"owners_count":20575250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-aurora","fiap","sql","terraform"],"created_at":"2024-12-01T04:11:58.760Z","updated_at":"2026-05-09T00:39:02.538Z","avatar_url":"https://github.com/soat-fiap.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bmb.database\n\n[![Terraform build](https://github.com/soat-fiap/bmb.database/actions/workflows/terraform.yaml/badge.svg?branch=main)](https://github.com/soat-fiap/bmb.database/actions/workflows/terraform.yaml)\n\n## Project Overview\n\nThis project contains the database schema and related files for the BMB application. The schema is defined using SQL scripts and managed with Terraform.\n\n## Folder Structure\n\n```\n/bmb.database/\n├── README.md\n├── main.tf\n├── variables.tf\n├── outputs.tf\n├── terraform.tfvars\n└── scripts/\n    ├── create_table_script.sql\n```\n\n## Dependencies\n- [VPC](https://github.com/soat-fiap/bmb.infra)\n\n## Getting Started\n\nTo get started with this project, ensure you have Terraform installed. Then, initialize and apply the Terraform configuration:\n\n```sh\nterraform init\nterraform apply\n```\n\n\n## ERD\n\n```mermaid\n erDiagram\n   \n    Products {\n        char(36) Id\n        varchar(100) Name\n        varchar(200) Description\n        int Category\n        decimal(10) Price\n        varchar(1000) Images\n    }\n    \n   Orders {\n        char(36) Id\n        char(36) CustomerId\n        char(36) PaymentId\n        int Status\n        datetime Created\n        datetime Updated\n        varchar(7) TrackingCode\n    }\n    \n    OrderItems {\n        char(36) OrderId\n        char(36) ProductId\n        varchar(200) ProductName\n        decimal UnitPrice\n        int Quantity\n    }\n    \n    Orders ||--|{ OrderItems : \"contains\"\n    Products ||--o{ OrderItems : \"included in\"\n```\n\n## No more Customers table\nThe 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.\n\n## Why MySql?\nI've decided to use MySQL as the database for the fast-food ordering system following the reasons below:\n\n* **Simplicity:**\n    * Easy installation, configuration, and management, ideal for both the development team and the production environment.\n    * Familiar and widely used SQL syntax, simplifying query writing and maintenance.\n* **Performance:**\n    * High performance for **TRANSACTIONAL OPERATIONS**, ensuring fast processing of orders and payments, even during peak hours.\n    * Efficient query optimization and indexing features for quick response times.\n* **Reliability:**\n    * Data integrity features and ACID properties (Atomicity, Consistency, Isolation, Durability) guarantee information consistency and security.\n* **Cost-effectiveness:**\n    * Open-source solution with no licensing costs, making it an affordable option for the project.\n    * Extensive user community and comprehensive documentation readily available online.\n\n* **Aurora Serverless**\n    - 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\n## This repo on the infrastructure\n\n![Architecture Diagram](aws-infra-phase-4.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoat-fiap%2Fbmb.database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoat-fiap%2Fbmb.database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoat-fiap%2Fbmb.database/lists"}