This repository has been archived on 2023-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
soft-arch/src/sa/model/decisions/0005-postgres-as-rdbms.madr

37 lines
1.6 KiB
Plaintext

## ADR #0005: PostgreSQL is the database implementation to use
_ADR depends on [ADR #0003: Use RDBMS as main choice for database technology](#adr0003)_
1. **What did you decide?**
PostgreSQL is the RDBMS implementation to be used in all stateful components of SmartHut.
2. **What was the context for your decision?**
A suitable RDBMS implementation shall be found to store the data for all stateful components in the component diagram. The technology shall be as ANSI SQL compliant as possible, battle-tested and provide easy JDBC integration, as the users and devices backend is already implenented using the Java Spring framework.
3. **What is the problem you are trying to solve?**
Which RDBMS implementation is the best choice for all stateful components?
4. **Which alternative options did you consider?**
- MariaDB
- PostgreSQL (postgres)
- Microsoft SQL Server (mssql)
5. **Which one did you choose?**
- PostgreSQL (postgres)
6. **What is the main reason for that?**
PostgreSQL is the only RDBMS technology in the list to be fully ANSI SQL compliant while also being widely adopted in industry. Additionally, PostgreSQL provides additional support for features like JSON-aware string queries and direct support for hierarchies, which may come handy when designing the schema of each component's database.
Pros:
- FOSS technology;
- Battle-tested;
- ANSI SQL compliance + additional advanced features.
Cons:
- Using advanced features may lock-in this choice more than necessary and make a future switch to another technology harder.