They Let Me Deploy Spring Boot Code in Production

Tags: java spring microservice

alt text SPOILER ALERT: No I did not break production…I think

Although I have been working as a Data Scientist (henceforth shortened to DS) for the past 5 years, DS was actually never part of my university degree. My introduction to DS came when I decided to base my thesis on automated algorithmic trading with applied machine learning. This in fact was what helped me land a job in DS once I graduated.

The degree itself was very much focused on Software Engineering and Web Development; this meant that I actually never wrote any Python code, Python being a rather unpopular language for web development at the time[0]. Instead I wrote a lot of Java, C#, PHP, and JavaScript. Although I did teach myself Python for my thesis.

Okay. So, why am I telling you all of this? Well I recently got to take off my DS hat and play Software Engineer (henceforth referred to as SWE) for a few days. I have been interested in giving SWE a try for a while now as I’ve been meaning to improve my engineering skills for the deploying of DS models in the future. It is also my impression that ML (Machine Learning) is slowly moving towards more engineering heavy roles such as MLE (Machine Learning Engineering) or SWE roles specialised in data.

My reasoning was that it would be a good idea for me to learn how to ship some back-end services in production and, lucky for me, I was given the opportunity to work on a ticket for my employer. That’s right, I found someone crazy enough to let me ship my crappy code to production.

alt text

These two disciplines (DS vs. SWE) are quite far from each other, both in knowledge and tech stacks. My employer’s tech stack is also based on Java (Spring Boot) rather than Python. This means that I pretty much came into this not knowing anything.

Why was this scary?

alt text

My task

alt text

I needed to add a new field to an existing micro service. This meant that the service, which was already listening to a particular event through Kafka, needed to now grab this new field, and persist it should it’s value differ from what already exists in the service’s database.

The service would also need to republish this new field back to Kafka as part of an existing event, and additionally in an existing RPC endpoint for other services to call directly.

I also needed to update the protobuf files used by Kafka to add the new field for other services to consume.

So, I basically needed to grab something from A, put it in B, and put it back in A. Sounds simple right?

What went wrong

What I learnt

alt text

alt text source

alt text

alt text

Getting started

A somewhat ordered list.