DEV Community

Alejandro Barba
Alejandro Barba

Posted on

How Changing Requirements Shape the Infrastructure of a Software Project

🎬 Introduction

Since few weeks ago I'm learning about AWS SAM so I decided to create a small project to put in practice what I've been learning.

The project is a wallet app with features we all know:

  • Register incomes and outcomes.
  • Categorize the incomes and outcomes.
  • Label the incomes and outcomes

An important requirement of this dummy wallet app was to allow users to create and manage their own categories for tracking incomes and outcomes. But, these categories needed to be private to each user meaning that a category created by one user could not be shared with another.

💪 Hands To Work

So I started designing the DB using this cool tool. The project has 2 tables, users and categories . The user can create many categories as he wants so the first approach I took was creating a third table, a union table to store user_id and category_id.
With this solution the users are able to create x numbers of categories and we can see assign the category to the user.

Example:

db_diagram

⚠️The problem

Technically, this approach works but something smells weird here. While it correctly assigns categories and users, the current design allows to assign a category created by User A to User B.
For example if user Alejandro creates the "Health" category, this category can be assigned to user Edith by simply creating the record in user_categories table. But the requirement is clear: A user can create as many categories as they want, but these categories must not be shared. Categories created by a specific user should remain tied to that user only.

🤓 The Solution

Although we can enforce this rule both on the backend and frontend, it’s generally a good practice to align all components with the project’s core requirements to maintain clarity and consistency.

So at the end, I've changed the design to this:

db_diagram

This aligns with the given requirement and reduces the complexity of the database.

🧠 Conclusions

I know this is a very basic example but its clear and concise. While coding is a crucial (and funny) part of the job, a software engineer’s role is to think critically about the design choices, taking into account factors like maintainability, security, and scalability.

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo 📊✨

Top comments (0)

Jetbrains Survey

Calling all developers!

Participate in the Developer Ecosystem Survey 2025 and get the chance to win a MacBook Pro, an iPhone 16, or other exciting prizes. Contribute to our research on the development landscape.

Take the survey

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay