PC#6 - The Ingredients to Delicious Software

The Art of Bringing Change + Creating Time

I was asked this interview question and it turned into a debate.

What are the core concepts you consider before designing a system?

Turns out, there’s no fixed answer to this question but there are endless possibilities.

Let’s look at a few of them.

Scalability

Let's say you run a restaurant.

And are committed to keeping the same level of service no matter how many customers turn up.

How to scale your service when the number of customers increases from 10 to 50?

Or from 50 to 100? Or from 100 to 500?

If waiters become a bottleneck, you can always add more waiters.

If the cook's bandwidth is an issue, you can add more cooks to share the workload.

But what if there's a point where adding more resources (waiters & cooks is no longer cost-effective?

Scalability is the ability of a system to handle an increased workload by repeatedly applying a cost-effective strategy.

But there's no such thing as infinite scalability.

Meaning at some point, scaling is no longer cost-effective.

The below illustration shows what scalability looks like in the real world.

Latency & Throughput

Let's say Tom goes to a restaurant and orders a cheese sandwich.

The waiter takes the order & returns with the sandwich after 10 minutes.

That's the latency.

Latency = time it takes for a system to respond to a request

But what about throughput?

Imagine Tom, Jack & Darcy go to the restaurant and give their order (cheese sandwiches).

The restaurant was able to handle all the requests.

That's throughput.

Throughput = number of requests that a system can handle within a given amount of time.

Availability and Consistency

Let's say the restaurant has 2 cooks and one of them goes on leave.

Can the restaurant operate without the missing cook?

If yes, you can say the restaurant is available.

So, how do you measure availability?

In software systems, we use the concept of nines to measure availability

  • Three nines = 99.9%

  • Four nines = 99.99%

Here’s a nice little table that shows various availability levels with the corresponding downtime expectations.

So, what about consistency?

Consider that the restaurant maintains 3 copies of all the orders made by the customers:

  • Waiter's copy

  • The cook's copy

  • The billing counter copy

Are the 3 copies always in sync?

Or can they have different information?

It depends on the consistency level of your app

Ultimately, designing a system is a game of trade-offs.

There is no exact recipe for designing a system.

All we have is a bunch of ingredients you can mix and match to create a delicious system or horrible-smelling froth that no one wants to eat.

And that's what makes it so interesting.

Every developer has their own view on what's important for designing the perfect system.

Just to give you a sense of scale, here are a few other concepts you might consider without even thinking too much:

  • Cost

  • Cohesion & Coupling

  • Team Size, Topology & Performance

  • Security

  • Reliability, Efficiency & Maintainability

  • Profitability (hard to argue with that)

The Art of Bringing Change To Your System

As developers, we all want to make a good contribution to the system.

But often, we run into disagreements with our teammates or decision-makers.

So, how do you bring a change to your current system when no one agrees?

Here’s a simple trick that has worked for me many times:

  • Build an awesome proof-of-concept for your idea

  • Present it to the stakeholders

  • Let them know it can be even better if we add X

  • Offer to add X if they are interested

Mostly, the stakeholders will agree.

Why?

Because everyone wants to ride the wave. But few want to start it.

Once the wave is in motion and it looks fun, people will want to hop on and be a part of it. That’s just how normal human psychology works.

Finding Time vs Creating Time

I often hear developers complain - "I don't find the time to do X".

And I tell them - “Of course, you won’t”

This is because you cannot ever FIND the time to do something.

If you truly want to do something, you've to act consciously to CREATE the time.

Basically, it’s an act of creation and the choice is in your hands.

Here are 4 steps that always help me create time (when I’m overwhelmed):

  • Slow down and take a pause

  • Think about what really matters to you

  • Compare it to what you're actually doing at the moment

  • If things don’t match, stop doing what you’re doing and start doing what matters

That’s it for today!

Have a great weekend and see you next week.

In case you want me to cover any specific topics in future editions, please fill out this form to suggest ideas.

Reply

or to participate.