Being Chief Technology Officer: Lessons learned in my first year

Happy New Year!

2020 was a difficult year for most of us, as we fought with COVID-19 and came to terms with the remote way of working. It was a year when we had a lot more time in our hands as all of us were locked in our houses with almost no travel. The things that we took for granted were taken from us and there was a constant fear of losing the loved ones. 

I hope in 2021 we regain our freedom to live freely. But, this time with a sense of responsibility and awareness. 

It is now little over a year since I became Chief Technology Officer (CTO) in my current organization. And, I thought it will be a good time to do a quick retrospective on the lessons learned in my first year as CTO. The journey has been tough but deeply rewarding for me. There were occasions when I thought the leadership role was not for me and I should go back to being an individual contributor. But, with support from my organization and learning (books, blogs, observation), I have started to enjoy the role and its challenges.

Before I talk about the lessons I learned, let’s look at my software engineering journey.  

Continue reading “Being Chief Technology Officer: Lessons learned in my first year”

My Notes on Deep Work Book

I decided to spend year-end holiday time reading a couple of books. I like to read books that in some way help me solve problems that I face in professional and personal life. At work because of my title and circumstances I have to play three different roles – maker, manager, multiplier. 

  • Maker: Create stuff (software, powerpoint, design document, etc).
  • Manager: Talk to people about their concerns and hopefully resolve them or at least guide them in the direction that takes them on the resolution path. Keep the stuff moving.
  • Multiplier. Enabling people by helping them in software design, code reviews, estimates, hiring right people, etc.

I am fortunate that I get to work on many tasks that are cognitively demanding. At the same time, I also have to work on tasks that don’t demand such cognitive skills.

Continue reading “My Notes on Deep Work Book”

Defining Your Engineering Team Principles

In my current role as Chief Technology Officer (CTO), I am responsible for the engineering quality of our software delivery teams. We are an IT service organization where every now and then, we get to work with different kinds of customers in different domains and each at a different maturity level in software delivery. 

One thing that I often struggle with is how to unite the individual engineering teams working for different customers with a common shared belief system that is actionable, pragmatic, and less abstract.

You may ask, isn’t that what organization values stand for? Before we answer, let’s define the three common terms: Values, Principles, and Practices.

Continue reading “Defining Your Engineering Team Principles”

On Mediocrity

In the last couple of years, one question that I have been often pondering is—

why it is difficult for senior leaders of an organization to work in unison and achieve great things together. While there are organizations that accomplish amazing things one after another, there are many others, where leaders cannot think beyond themselves and their self-interests.

The failure, in context of the blog, is not about an organization failing financially or collapsing in terms of business. An organization can be successful yet fail to achieve great things. This is a story that I have seen, read and observed, over the years. A new senior leader joins or an existing employee is promoted to a leadership role. They want to bring positive changes (at least they think that way) and become messiah for the organization. After a couple of years, there are only little achievements to be shown, nothing big and transformative that may have been realized or accomplished.  

Continue reading “On Mediocrity”

Using Testcontainters with Kotlin Spring Boot App

In this quick post I will show you how to use Testcontainers with Kotlin Spring Boot app. Testcontainers is a Java library that you can use to write integration tests that work with real third-party services like databases, message queues like Kafka, or any other service that can be packaged as a Docker container image.

Most developers use in-memory databases or fakes to test with external dependencies but to test against real stack you need to use real services. This week I faced as issue where one of my test was failing because a MySQL function was unavailable in H2. I was using in-memory H2 database in tests. My application used MySQL in the production mode. So, my valid MySQL query was not working when run in a test. This made me think of replacing H2 with MySQL database for tests.

I was aware of Testcontainers but had never used it in any application. So, this was the first time I used it. For most parts I liked it. I don’t have to work around limitations of H2 and I can hope I will not discover any issues because of difference between H2 and MySQL. Testcontainers is not perfect. It makes test slow. My build time has increased from 6 mins to 9 mins just because of Testcontainers. I am relying more on my CI server to run the complete test suite.

Testcontainers can do much more than running databases. You can use Testcontainers for:

  • Stream processing solutions like Apache Kafka and Apache Pulsar
  • AWS Localstack
  • Selenium tests
  • Chaos tests
Continue reading “Using Testcontainters with Kotlin Spring Boot App”

My Thoughts On Monorepo

Before we start let me give some context on my background so that you can better understand my thoughts on Monorepo. 

I head technology at an IT services organization. Most of the products that I build are using Microservices architecture, have multiple frontends(web and mobile). The biggest product that I recently built had close to 30 microservices, 1 web client written in React,  and native mobile app built using React Native. These numbers are nowhere near the numbers big product companies have shared. 

I prefer Macroservices over Microservices. I think most products don’t need more than 10 microservices. 

Continue reading “My Thoughts On Monorepo”

Writing scripts in Java 11 and beyond

Many Java users hate it at times for being too verbose. Many of us have started using other languages like Kotlin or Scala for their terseness and expressiveness. One of the feature that Java programmers like about these modern languages is their ability to do quick experimentation. There are times you do not want to create a project in your IDE, configure build tool, create package structure and then write the code. There is a lot of yak shaving involved before you can automate that one thing that is nagging you. You just want to write a script and move on.

Before JDK 11, Java language did not give you the means to achieve this. Since Java 11, you can write single source file scripts to automate tasks. You do not have to compile the Java file before executing it. You write your Java file and then directly execute it.

Continue reading “Writing scripts in Java 11 and beyond”

Sending Outlook Calendar Invite using Java Mail API

Today I had to implement a functionality related to sending Outlook Calendar invite. The app backend was written in Java. As it turns out the simple task of sending a calendar invite is much more complicated than I expected. You have to construct the message with all the right parameters set else your calendar invite will not behave as you expect. I wasted an hour or two figuring out why RSVP buttons are not coming in the invite. As it turned out it was one of the missing parameters that caused the issue. Also, I wanted to send calendar invite to both outlook and Google calendar.

Continue reading “Sending Outlook Calendar Invite using Java Mail API”

Writing Bencode Parser in Kotlin

This week I decided to write some Kotlin for fun. The best way to learn something while having fun is to build something with it. So, I decided to write a Bencode parser. From the Wikipedia[1],

Bencode is the encoding used by the peer-to-peer file sharing system BitTorrent for storing and transmitting loosely structured data.

Bencode supports four data types: Strings, Integers, Lists, and Dictionaries.

Strings are encoded as <string length encoded in base ten ASCII>:<string data>. So, spam becomes 4:spam

Integers are encoded as i<integer encoded in base ten ASCII>e. So, positive 3 becomes i3e and negative 3 becomes i-3e

Lists are encoded as l<bencoded values>e. So, list of [spam, eggs] become l4:spam4:eggse

Finally dictionaries are encoded as d<bencoded string><bencoded element>e. So, dictionary { "cow" => "moo", "spam" => "eggs" } becomes d3:cow3:moo4:spam4:eggse. You can have dictionary of any of the types supported.

I took the above examples from BitTorrent specification document[2].

Now that we understand about Bencode let’s start building the parser.

Continue reading “Writing Bencode Parser in Kotlin”

Paper Summary: Monarch: Google Planet-Scale In-memory Time Series Database

This week I read Monarch paper by Google engineers. The paper covers in detail design decisions involved in building Monarch. Monarch as the title of the paper suggests is an in-memory time series database. It is used by Google monitoring system that monitors most of the Google web properties like Gmail, Youtube, and Google Maps.

Every second, the system ingests terabytes of time series data into memory and serves millions of queries.

These are some very big numbers. Most of us do not have to deal with such large volume of data in our day to day work. Reading this paper can help us understand how engineers building such system make design decisions and tradeoffs.

Continue reading “Paper Summary: Monarch: Google Planet-Scale In-memory Time Series Database”