Beyond Writing Code: The Engineering Decisions That Make Software Reliable
Building software is easy compared to building software that remains reliable, maintainable and predictable when things go wrong.
There is a point in every developer’s journey when writing code stops being the most interesting part of building software.
When you’re starting out, the excitement often comes from getting things to work. You build an API, connect a database, create a user interface, integrate a third-party service and finally see everything come together. There is a certain satisfaction in watching something you wrote perform exactly as expected.
And that is perfectly fine. Getting things to work is where every developer starts.
But as you gain more experience, you begin to realize that making something work is only one part of the problem.
What happens when the API receives the same request twice? What happens when a database becomes unavailable halfway through an operation? What happens when two users attempt to update the same record simultaneously? What happens when an application that works perfectly with a few hundred records suddenly has to deal with millions?
These are questions that don’t always come up when you’re implementing a feature, but they become increasingly important when that feature becomes part of a production system.
Over time, I’ve become more interested in these questions. Not just how to implement something, but how to make sure it continues working under different conditions, how to make it easier to maintain and how to avoid introducing problems that will eventually become someone else’s responsibility.
This is where the difference between writing code and engineering software becomes more apparent.
1. Writing Code That Works Is Only the Beginning
One of the easiest mistakes to make when building software is treating successful execution as proof of a good implementation.
Imagine you’re building an endpoint that allows users to create orders.
You receive the request, validate the input, save the order to the database and return a successful response. Everything works as expected.
You test it locally, try a few different inputs and confirm that the endpoint behaves correctly.
From a functionality perspective, the implementation looks complete.
But consider a few additional scenarios:
- What if the user accidentally submits the request twice?
- What if the application times out after the order is saved but before the response reaches the client?
- What if two requests attempt to modify the same order simultaneously?
- What if the database connection drops during the operation?
- What if the request contains valid data but violates a business rule?
Suddenly, the problem becomes more interesting.
The initial implementation solved the immediate requirement, but it didn’t necessarily account for everything that could happen when real users interact with the system.
This is an important distinction.
A feature can work correctly under normal conditions and still be unreliable under unexpected conditions.
I think this is one of the biggest mindset shifts developers experience as they work on more complex applications. You gradually stop thinking only about the expected execution path and start considering the different ways an operation can fail.
The goal isn’t to anticipate every imaginable problem. That’s impossible.
The goal is to identify the risks that matter and design the system to handle them appropriately.
2. The Engineering Decisions Nobody Notices Until Something Breaks
Some of the most important engineering decisions are almost invisible when everything is working.
Nobody notices that an endpoint is idempotent until duplicate requests start arriving. Nobody appreciates proper transaction management until an operation fails halfway through. Nobody thinks about timeouts until an external service stops responding.
Let’s look at a few examples.
Idempotency: What Happens When Requests Are Repeated?
Consider a payment integration.
A user initiates a payment, but before receiving a response, their internet connection drops. They aren’t sure whether the transaction went through, so they try again.
If the backend processes both requests independently, the user might end up being charged twice.
This is where idempotency becomes important.
An operation is idempotent when repeating the same operation produces the same intended result as performing it once.
One common approach is to use an idempotency key.
The client generates a unique identifier for an operation and includes it with the request. The backend stores that identifier and associates it with the result of the operation.
If the same request arrives again with the same key, the system can return the previously recorded result instead of performing the operation again.
For example:
1
2
3
4
5
6
7
8
9
POST /api/payments
Idempotency-Key: payment-12345
Content-Type: application/json
{
"amount": 5000,
"currency": "KES",
"account_id": 42
}
The important part isn’t the header itself. It’s how the backend handles it.
The implementation needs to ensure that checking and recording the idempotency key is safe under concurrent requests. Otherwise, two requests arriving at almost the same time could both pass the initial check.
For financial operations, this becomes particularly important.
Idempotency doesn’t automatically make an entire payment system reliable, but it provides an important safeguard against duplicate processing.
Concurrency: What Happens When Multiple Operations Happen at Once?
Another interesting challenge appears when multiple users or processes interact with the same data.
Imagine an application managing inventory.
A product has five units available. Two customers attempt to purchase four units at almost exactly the same time.
Both requests read the available quantity and see five units.
Both conclude that enough stock is available.
Both proceed with the purchase.
The result is that eight units have effectively been sold when only five were available.
This is a race condition.
The problem isn’t necessarily that either request contains incorrect logic. The problem is that the operations interact in a way the implementation didn’t account for.
Database transactions, appropriate locking strategies and atomic updates can help prevent this.
For example, instead of reading the quantity, checking it in application code and updating it later, an application can perform a conditional update:
1
2
3
4
UPDATE products
SET stock_quantity = stock_quantity - 4
WHERE id = 10
AND stock_quantity >= 4;
The application then checks the number of affected rows.
If one row was updated, the stock reservation succeeded. If no rows were updated, there wasn’t enough stock available.
This is a simple example of moving an important consistency rule closer to the database.
The broader lesson is that software doesn’t always execute in the neat sequence we imagine when writing it. Concurrent operations introduce complexity, and the system needs to account for that.
Failure Handling: What Happens When Dependencies Fail?
Modern applications rarely operate independently.
They communicate with payment gateways, email providers, authentication services, external APIs, databases and other internal services.
This creates dependencies.
And dependencies introduce failure points.
Imagine an application that needs to send an email after a user completes registration.
Should registration fail completely because the email provider is temporarily unavailable?
Not necessarily.
The application could successfully create the account and place the email notification into a background job queue. A worker can then attempt delivery independently.
This separates the core business operation from a secondary operation.
Other situations require different approaches.
Timeouts prevent an application from waiting indefinitely for an external dependency.
Retries allow temporary failures to recover without requiring manual intervention. However, retries should use sensible limits and backoff strategies to avoid overwhelming an already struggling service.
Circuit breakers help prevent repeated requests to a dependency that is consistently failing. Instead of continuing to send requests that are unlikely to succeed, the application temporarily stops making those calls.
The important thing is understanding that failure handling isn’t simply about catching exceptions.
It’s about deciding what should happen when something outside your application’s control stops behaving as expected.
Performance: What Happens When Your Application Grows?
An application can perform exceptionally well during development and still struggle when real data starts accumulating.
One common example is the N+1 query problem.
Imagine retrieving a list of 100 orders and then fetching the customer associated with each order individually.
Instead of executing one query to retrieve the orders, the application might execute another 100 queries to retrieve their customers.
That’s 101 database queries for what could potentially be handled with a much smaller number.
In Django, for example, select_related() and prefetch_related() can help reduce unnecessary database queries.
1
2
3
4
5
orders = Order.objects.select_related(
"customer"
).prefetch_related(
"items"
)
This is a relatively small implementation detail, but it can make a meaningful difference when working with larger datasets.
Other performance considerations include:
- Pagination instead of returning entire datasets.
- Indexing frequently queried database columns.
- Caching expensive or frequently accessed results.
- Avoiding unnecessary serialization and computation.
- Monitoring slow queries.
- Understanding memory and CPU consumption.
Performance shouldn’t always be addressed through premature optimization.
However, understanding how your application accesses data and consumes resources is part of building software that can grow without becoming unnecessarily expensive or slow.
Maintainability: What Happens When Someone Else Inherits Your Code?
This is something I think deserves more attention.
Developers sometimes approach implementation as though they will be the only people interacting with the code.
But software rarely stays that way.
Teams change. Requirements evolve. Developers move to different projects. Applications get handed over to people who weren’t involved in their original development.
Code that makes sense to the person who wrote it might be unnecessarily difficult for someone else to understand.
This is where separation of concerns, meaningful naming, appropriate abstractions and consistent architectural patterns become valuable.
Consider the difference between a large function responsible for validating input, processing business rules, interacting with a database and sending notifications, versus a design where those responsibilities are clearly separated.
The second approach generally makes it easier to test, understand and modify individual parts of the system.
That doesn’t mean every small feature needs multiple layers, interfaces and abstractions.
Overengineering can be just as problematic as poorly structured code.
The goal should be to introduce enough structure to make the system understandable without creating unnecessary complexity.
3. Production Changes How You Think About Software
Something that works on your development machine isn’t automatically ready for production.
Development environments are often predictable. You control the data, know the configuration and can reproduce most of the scenarios you’re testing.
Production is different.
Real users behave in unexpected ways. Data grows over time. Network conditions fluctuate. External services experience outages. Configuration differences introduce problems that weren’t visible locally.
This is why production readiness requires a different mindset.
Observability Matters
When something breaks in production, the first question is usually: What happened?
Without meaningful logs, metrics and traces, answering that question can become surprisingly difficult.
Logging helps capture events and errors.
Metrics help you understand the behaviour of the application over time, including request latency, error rates and resource consumption.
Distributed tracing helps follow requests across different services, making it easier to identify where delays or failures occur.
Together, these practices provide visibility into how an application behaves beyond what you can observe during local development.
Deployment Is Part of Engineering
Another area that is sometimes treated as separate from software development is deployment.
But how software is deployed can directly affect its reliability.
Consider an application receiving requests continuously. Deploying a new version shouldn’t unnecessarily interrupt users or leave the system in an inconsistent state.
This is where deployment strategies become useful.
Rolling deployments gradually replace existing application instances with new ones.
Blue-green deployments maintain two environments and allow traffic to switch from one to the other.
Feature flags allow functionality to be enabled or disabled independently of deploying a new version.
Database migrations also need careful consideration, particularly when changes affect existing production data or multiple application versions.
And perhaps just as importantly, there should be a way to recover when a deployment goes wrong.
Rollback strategies, backups and tested recovery procedures are not things to think about only after experiencing a production incident.
They should be considered as part of the engineering process.
4. Architecture Is About Managing Trade-offs
One thing that becomes increasingly apparent as you work on different systems is that there is rarely one universally correct engineering decision.
A solution that works exceptionally well for one application might introduce unnecessary complexity in another.
Take microservices, for example.
They offer independent deployment, service-level scalability and the ability to organize systems around different business capabilities.
But they also introduce network communication, distributed tracing, service discovery, deployment complexity and additional operational responsibilities.
For a relatively small application, a well-structured monolith might be a much better choice.
The same applies to other architectural decisions.
Caching versus fresh data: Caching can improve performance, but introduces invalidation and consistency challenges.
Synchronous versus asynchronous processing: Synchronous operations are often simpler to reason about, while asynchronous processing can improve responsiveness and help handle workloads independently.
Abstraction versus simplicity: Abstractions can improve reusability, but unnecessary abstractions make systems harder to understand.
Strong consistency versus eventual consistency: Some operations require immediate consistency, while others can tolerate data becoming consistent over time.
Good engineering isn’t about choosing the most sophisticated architecture or adopting every new technology.
It’s about understanding the problem, evaluating the trade-offs and selecting an approach that makes sense for the system being built.
Sometimes the best engineering decision is choosing not to introduce another technology.
5. Understanding the Systems Behind the Frameworks
Frameworks make software development significantly easier.
They provide established patterns, reusable components and abstractions that allow developers to build applications without implementing everything from scratch.
But there is a difference between knowing how to use a framework and understanding the systems it operates on.
A developer working with Django benefits from understanding HTTP, database transactions, indexing, concurrency and query execution.
A developer building Flutter applications benefits from understanding application state, asynchronous operations, network communication, caching and lifecycle management.
A .NET developer benefits from understanding dependency injection, asynchronous execution, memory management and database interactions.
These fundamentals matter because frameworks cannot completely hide the behaviour of the systems underneath them.
Eventually, you encounter a problem that requires understanding what’s happening beyond the framework’s abstractions.
Maybe an ORM query is generating unexpected SQL. Maybe an asynchronous operation is causing unexpected behaviour. Maybe an application is consuming more memory than expected.
At that point, knowing which framework method to call isn’t enough.
You need to understand why the problem is happening.
This is one reason I believe continuously strengthening software engineering fundamentals is just as important as learning new technologies.
Technologies change. Frameworks evolve. Libraries get replaced.
But concepts such as concurrency, networking, data consistency, security and system design remain relevant across different technology stacks.
6. What I Consider Before Shipping a Feature
Over time, I’ve found it useful to think beyond whether the implementation satisfies the immediate requirement.
Before considering a feature complete, there are several questions worth asking.
Input and validation
- Does the implementation handle invalid and unexpected input?
- Are business rules enforced consistently?
- Are sensitive operations properly authorized?
Reliability
- What happens if the request is submitted multiple times?
- What happens when a dependency becomes unavailable?
- Can the operation leave the system in an inconsistent state?
Data and performance
- Can concurrent operations introduce race conditions?
- Are database queries efficient?
- Will the implementation behave reasonably as the dataset grows?
Maintainability
- Are responsibilities clearly separated?
- Can another developer understand the implementation?
- Have unnecessary abstractions and complexity been avoided?
Operations
- Are important errors logged?
- Can the behaviour of the feature be monitored?
- Can the feature be deployed and rolled back safely?
Not every feature requires the same level of consideration.
A simple informational page doesn’t need the same engineering safeguards as a payment processing system.
The important thing is applying the right level of engineering discipline based on the risks and responsibilities of the feature.
7. Becoming an Engineer Who Thinks Beyond the Code
I think one of the most interesting parts of growing as a software engineer is how your definition of a good solution changes.
Initially, you might be excited about implementing a feature using a new framework or technology.
Later, you become more interested in whether the implementation is actually the right approach.
You start asking different questions.
Is this abstraction necessary? Could this operation introduce a race condition? What happens if this API becomes unavailable? Are we solving the actual problem or just adding another layer of complexity?
You also become more conscious of the fact that software doesn’t exist in isolation.
It has users, infrastructure, dependencies, business rules, data and people responsible for maintaining it.
A technically impressive implementation means very little if it creates operational problems, introduces unnecessary complexity or becomes difficult to maintain.
This doesn’t mean every developer needs to become an expert in infrastructure, databases, security, architecture and every other area of software engineering.
But understanding how these areas interact makes you better at the decisions you make within your own area of responsibility.
The goal isn’t to know everything.
It’s to develop the judgement to know what matters, where to investigate and when a particular decision could have consequences beyond the code you’re currently writing.
Final Thoughts
I’ve come to appreciate that the hardest part of building software isn’t necessarily writing the code. It’s understanding the consequences of the decisions we make while writing it.
A feature can work perfectly and still introduce problems that only become visible weeks or months later. An implementation can be technically impressive but unnecessarily difficult to maintain. An application can perform well with ten users and struggle when that number becomes ten thousand.
These realities have changed how I approach software development.
I think more about failure, data consistency, maintainability, performance and the people who will eventually work with the systems I build.
I still enjoy learning new technologies, exploring frameworks and experimenting with different approaches. But I’ve become increasingly interested in understanding why things work the way they do, and more importantly, what happens when they don’t.
Because ultimately, writing code is about solving a problem today. Software engineering is about making sure that solution continues to serve its purpose tomorrow.
And perhaps that’s one of the most important things experience teaches you: the quality of software isn’t just determined by what it does when everything works, but also by how it behaves when things don’t.
