Skip to content

Category: Algorithms and Programming

Six Patterns to Optimize Your Monolithic Codebase

Migrating to microservices isn’t always needed: first, you must fix your monolith.

The tech industry, and software engineers, are wired for the new and the flashy. That’s also why we see dozens of new javascript frameworks getting created every year, the majority of which end up burning into oblivion as they re-enter the Earth’s atmosphere—well, except for jQuery, which somehow keeps surviving.

The same can be said of architecture: almost every time I hear or read someone mention monolithic architecture, there’s almost always a negative connotation associated with it, because it has this feeling of old and outdated.

But simply because monolithic architectures are older doesn’t mean they’re bad, or that they’re less, compared to service-oriented architecture or to serverless.

This reputation comes from the fact that most monolithic architectures end up turning into giant spaghetti monsters of code, difficult to build, deploy, and evolve. I agree with that, that has also been my experience.

What I disagree with is the speed with which many engineers are ready to discard monolithic architectures entirely and switch to something else, say microservices, which they understand even less, instead of trying to fix what’s already there. There’s a lot of hype involved with such pushes, because it entails using new cool frameworks, new programming languages, and so on.

In addition to that, there’s often a lack of understanding from engineers that the decision of choosing an architecture must never depend only on technical considerations. In fact, it should be the other way around: picking an architecture should always be done by putting most weight on what will best serve the business needs and growth of the company over time, and take technical considerations only as a second-order concern.

And before discarding an entire architecture or codebase, one should always strive to fix it with what’s already there.

In this article, I want to share techniques I’ve seen deployed in production and which have helped make monolithic codebases easier to work with. I’ve seen first-hand that they were successful in improving build times and consequently deployment times.

The six patterns for optimizing your monolithic architecture are:

  1. Remove build bottlenecks
  2. Extract frequently updated code areas into their own modules
  3. Clean up unneeded dependencies
  4. Clean up unused code
  5. Enable server-side caching in your CI/CD
  6. Use subviews to mock dependencies

In the rest of this article, I will share more details about those techniques, and how to go about using them

I’ll be using the term “microservices,” as if I’m taking the perspective of a backend system. But this article also applies to frontend applications and to microfrontend architectures. Also, I’m going to stay very generic in my statements, and that’s intentional: I want to focus on the big picture ideas without being specific to a particular language or toolchain.

A Complete Overview of Front-End Development in 2021

Wasm, ESLink, Webpack, Serverless. Does this ring a bell? Do you know what these technologies are used for?

There are so many concepts and frameworks used by front-end developers, it’s hard to keep track when you don’t work on it every day.

I recently spent time brushing up my front-end knowledge and skills, and I wanted to share what I learned.

In this article, I give a concise yet complete rundown of all the main technologies used for front-end development, along with resources to dive deeper where needed.

I Invested in Myself: I Hired a Copy Editor to Improve My Writing

I invested in myself.

I hired a copy editor to review a 4,000-word draft I was working on. 48 hours and $180 later, he had left 439 edits and comments on my draft, along with a gold mine of feedback on how to improve my writing skills.

Why care about writing? In these times of continued lockdowns and remote work, more communication happens in written form, whether it’s emails, messaging, or long-format reports and articles. More than ever before, your mastery of the written word can boost your career in unexpected ways.

Besides, writing skills will be useful to you in any job you’ll have in the future, and regardless of industries. It’s one of those skills that’s entirely transferable, like public speaking and negotiating.

Hiring an editor to review your writing and giving you feedback is one of the best gifts to offer yourself.

Here I share my experience doing it along with tips on how to make the process as fruitful as possible, hoping it will help you too.

How to Keep Your Tech Skills Sharp in a Leadership Role

When I became a senior engineering manager three years ago and had multiple teams reporting to me, I was no longer building things on the job myself. This was the first day of the decay of my pure technical skills, and with it came the question of what I was going to do about it.

Fast-forward to March 2020, I’m sprinting through the Sao Paulo airport, hugging my carry-on luggage close to my chest and dodging other travelers as best I can. I was visiting South America when COVID-19 hit Europe and air traffic started shutting down. I was heading back home to Amsterdam and my connecting flight from Buenos Aires had landed an hour late. So I made a run for it. If I didn’t catch this flight, I was going to be stranded 10,000 kilometers away from home.

Fifteen minutes, 40 gates, and a wobbly knee later, I finally reached the boarding area completely out of breath and managed to catch my flight home.

When I got back to work in the following days, most of my colleagues had been working from home via video calls for about a week already. I had missed the early days of the quarantine, but luckily the local supermarkets hadn’t been raided too badly, and I was able to get my hands on toilet paper.

As I started setting up my quarantine routine, I made the decision to tackle the hitch that had been annoying me for a long time, and by this I mean I was determined to catch up with the cutting edge in tech.

My plan was simple: I was going to build a web app as a pretext to learn an entire tech stack end to end. I actually tracked the time I spent on it weekly to hold myself accountable, and it worked!

After more than 100 hours of coding and learning between April and November 2020, I launched the MVP for Sidenote.me, a web app to take time-stamped notes on videos. In the process I learned in-depth about TypeScript, Node.js, and MongoDB, and I performed a high-level refresher on the state of the industry in other tech ecosystems, such as containerized infrastructure, micro frontends, and serverless computing.

Launching Sidenote 🚀

If there’s one lesson that 2020 has taught me, it’s the value of focusing on opportunities rather than lamenting myself on what is not possible or what was taken away. I took advantage of the quarantine to go back to coding on a regular basis during my free time, and in the process I learned about TypeScript, Node.js, and MongoDB.

When I took a more managerial path early 2016, my focus naturally switched towards organizational topics. I must admit it did feel that my tech chops were slowly getting rusty, and I knew I had to do something about it. So when the first quarantine started, I set a simple goal for myself: to code for at least three hours per week. I actually tracked the time I spent on it to hold myself accountable, and I did hold onto it.

Today, after more than one hundred hours of coding and learning spent between April and November 2020, I am super proud to announce that I am launching an MVP for Sidenote.me, a web app to take timestamped notes on videos. If you’re reading this post until here, it would mean the world to me if you gave it a try just for a minute and then posted your feedback in the comments section below. And if you like it, talk about it on your favorite social media.

By the way, I’m going to be posting on this tech blog again very soon, about engineering and leadership topics. Subscribe to my newsletter below for fresh articles.

Join my email list

Service Ownership Checklist

Building and maintaining infrastructure services requires to strive for quality and ownership. But it’s not always easy to know what we are missing, and what assumption we are making that we don’t know of. To help myself and my colleagues reason about whether we are addressing the important topics, I came up with something I call the Service Ownership Checklist. It’s still in a draft format, but I’ve already refined it thanks to the help and feedback of many of my peers around me, and I’m now releasing it on my blog hoping that it can help other infrastructure engineers as well.

The way to use this document is to share it with your colleagues and teams, and have them ask each other some of the questions to see how they’re doing on all these topics and challenge their assumptions. You will hopefully uncover unknown issues, and create enough urgency to go and fix them.

This blog post is organized in two parts. The first part is the Service Ownership Checklist, a set of loose questions that can be used in brainstorming and sharing sessions, and the second part is a condensed version in the form of a questionnaire, the Service Ownership Questionnaire, which shows the different levels of quality for each reliability topic.

The SRE organization at Google is running Launch Reviews when they release new services, and for this they use a Launch Review Checklist. I recommend that you read Chapter 27 of the Google SRE book, which covers the subject.

Finally, if you think of any other topics, or of a better way to group the questions into categories, please post a comment below! And if you enjoyed this article, subscribe to the mailing list at the top of this page, and you will receive an update every time a new article is posted.

How to get started with infrastructure and distributed systems

Most of us developers have had experience with web or native applications that run on a single computer, but things are a lot different when you need to build a distributed system to synchronize dozens, sometimes hundreds of computers to work together. I recently received an email from someone asking…

Implementing a Key-Value Store – Part 9: Data Format and Memory Management in KingDB

This is Part 9 of the IKVS series, “Implementing a Key-Value Store”. You can also check the Table of Contents for other parts. In this series of articles, I describe the research and process through which I am implementing a key-value database, which I have named “KingDB”. The source code is available at http://kingdb.org. Please note that you do not need to read the previous parts to be able to follow. The previous parts were mostly exploratory, and starting with Part 8 is perfectly fine.

In this article, I explain how the storage engine of KingDB works, including details about the data format. I also cover how memory management is done through the use of a compaction process.

Implementing a Key-Value Store – Part 8: Architecture of KingDB

This is Part 8 of the IKVS series, “Implementing a Key-Value Store”. You can also check the Table of Contents for other parts. In this series of articles, I describe the research and process through which I am implementing a key-value database, which I have named “KingDB”. The source code is available at http://kingdb.org. Please note that you do not need to read the previous parts to be able to follow. The previous parts were mostly exploratory, and starting with Part 8 is perfectly fine.

In the previous articles, I have laid out the research and discussion around what needs to be considered when implementing a new key-value store. In this article, I will present the architecture of KingDB, the key-value store of this article series that I have finally finished implementing.