Think Like an Architect 01 - Javascript Developer Guide
Every decision you make in software or application development is based on reasoning, facts, and figures. But what happens when ownership changes and a new architect asks why you chose PostgreSQL over MongoDb? A general industry answer won't satisfy an architectural perspective.
Why Documentation Matters
The tech stack, tools, and methodologies vary from project to project. You might drive a SUV or a Sedan — each is made for a different purpose. Similarly, when selecting a tech stack, you likely perform:
- Feasibility studies
- Long-term sustainability analysis
- Proof of Concept (POC) to validate the business value
All these analyses are conducted before selecting tools. But years later, when someone asks why a specific choice was made, how do you answer? This is where Architectural Decision Records (ADR) become invaluable.
How ADR Helps
ADRs are not about short-term decisions. Well-established software always needs a roadmap and clear milestones. Each development stage should not question why a choice was made.
Suppose a vulnerability arises due to a past decision. You cannot just integrate something new without considering the architecture. With an ADR, you can review why a specific decision was made — from developer, business, and stakeholder perspectives — keeping the project aligned.
Example: ADR Document
ADR 001: Use PostgreSQL as Primary Database
Status: Accepted
Date: 2026-01-02
Context and Problem Statement
We need a relational database for our new web application to store user data, transactions, and product catalog. The database must support:
• ACID transactions
• Complex queries
• Scalability for future growth
• Strong community support
Decision Drivers
• Reliability and maturity of the database
• SQL compliance
• Ease of deployment and management
• Cost considerations
Considered Options
1. PostgreSQL
2. MySQL
3. MongoDB
Option 1: PostgreSQL
• Pros:
◦ Advanced SQL features and strong ACID compliance
◦ Open-source and widely supported
◦ Good support for complex queries and indexing
• Cons:
◦ Slightly higher memory usage than MySQL
• Decision: Chosen
Option 2: MySQL
• Pros:
◦ Popular and widely used
◦ Easy to set up
• Cons:
◦ Limited support for advanced queries and some ACID features
• Decision: Rejected
Option 3: MongoDB
• Pros:
◦ Flexible schema, good for unstructured data
◦ Horizontal scaling
• Cons:
◦ Not ACID-compliant for multi-document transactions (in older versions)
• Decision: Rejected
Decision Outcome
PostgreSQL will be used as the primary database for our application. The development team will follow best practices for database design and use migration tools to manage schema changes.
Pros and Cons of the Decision
• Pros:
◦ Reliable, scalable, and feature-rich database solution
• Cons:
◦ Slightly higher memory and operational overhead compared to MySQL
Where Developers Get Involved
From project planning, developers contribute to software decisions. It's not just regular documentation — it’s about thinking slightly outside the frame, recording decisions formally, and aligning with the ADR concept. This approach ensures your software is architected in a professional, maintainable way.