Serverless Introspection Is Not Just For Machines

Lee Priest
Engineers @ The LEGO Group
7 min readJul 4, 2022
Photo by Jordan Harrison on Unsplash

There is a fundamental shift between thinking about UI layouts and interactions to the architectural and infrastructure based thinking that comes when working with Serverless

Hello there, I’m Lee. I’m a relatively new hire at the LEGO Group, joining in January 2022. As a noob to the Serverless world, I thought it may be interesting to share my onboarding experience. Grab some snacks and a drink and hover your cursor over the close button as I dive in.

So far, so…

I can’t lie, this has been me at times…

My experiences so far within the wild and wonderful world of engineering have centred around frontend technologies. From changing border colours to building interactive learning platforms, to integrating software and hardware for interactive experiences. I have always tried to keep my ear to the internet and keep up with the latest and greatest technologies.

I had heard the term ‘Serverless’ being thrown around on the internet but it ended up being a term that was added to the to learn at some point list. Upon joining the LEGO Group this quickly became priority number one to learn.

A world without servers!?

Photo by Umberto on Unsplash

When I first sat down to think about what Serverless meant and how it could work I was quite confused. My understanding of how websites managed to appear on the internet was that they needed to be hosted on a server. Then some magical configuration would be done that would allow me to visit them. I asked myself “what kind of crazy voodoo allows a website to function without a server?”.

Enter AWS and the Serverless framework (other providers and frameworks available).

I had some experience with AWS from past roles but these revolved around technologies such as EC2 and Elastic Beanstalk. After doing some reading and watching some videos I got a better picture of what constituted ‘Serverless’. Lambda functions, API Gateway and Cloud Formation were just a few of the technologies that began spinning around in my head.

Armed with this knowledge I hit Udemy hard and purchased some courses. I also took advantage of the LEGO Group’s learning platform options.

I approached the courses with a type of excitement I hadn’t had since Pokemon Gold and Silver were released back in 1999. While progressing through the courses it became more and more apparent that I had entered a brave new world and that I would need to rearrange my brain space somewhat. The infrastructure as code coupled with the microservices approach was also new to me but something that I quickly grew to like.

One of the main challenges I faced was the paradigm shift between ‘thinking in frontend’ to ‘thinking in Serverless’

The challenge is real

Photo by Towfiqu barbhuiya on Unsplash

One of the main challenges I faced was the paradigm shift between ‘thinking in frontend’ to ‘thinking in Serverless’. There is a fundamental shift between thinking about UI layouts and interactions to the architectural and infrastructure-based thinking that comes when working with Serverless. At first, I likened the shift in thinking to the jump from using jQuery to using React. The difference in approach was quite stark.

The amount of moving parts there appeared to be within the Serverless approach was another part that took me a little bit of time to adjust to. Having a Lambda function that creates an event, that then fires off another Lambda function, that then does some other magic was something I struggled to keep straight in my head.

Although it may sound like I’m lighting the warning beacons of Gondor in relation to starting with Serverless. Rest assured that I am not. This change in direction has been somewhat refreshing.

Getting stuck in with the Serverless framework and snooping around the AWS console has enabled me to start getting a clearer picture of the voodoo magic that is AWS and its many, many services. I’m also gaining fresher insights into the full picture of the engineering process rather than just the frontend UI and interactions.

Can we just take a second to acknowledge how scary a serverless.yml file is to someone who hasn’t worked with one before, please!?

My first time

It’s hard to argue with this one

I remember my first time having a browse through the Git repositories that we are responsible for in the Loyalty squad at the LEGO Group and having a feeling like I was starting my engineering career over.

From what I could make out there appeared to be lots of config-like files which were long and scary looking. Can we just take a second to acknowledge how scary a serverless.yml file is to someone who hasn’t worked with one before, please!?

The more I looked over the repo the further down the rabbit hole I felt I was falling. After a few energy drinks and internal pep talks though, I slowly started to piece together how things fit together. I then set out on a mission to figure out what everything I just looked at meant.

My first port of call was to message my squad mates for some extra context around what was what. Thankfully they had the patience for my numerous questions and gave some recommendations on some more materials and courses to look at. While the courses I had enrolled in previously had given me a soft introduction to Serverless overall they didn’t drill into the sort of detail the Loyalty magicians had in their work.

I remember running through a course and building an auction service, this course was like Morpheus handing me the red pill. This course really helped me start to get things clearer in my mind. I gained an understanding of Serverless Framework, microservice architecture, and .yml files to name just a few.

The further I got into this course and the others the more I wanted to learn and the more excited I got to learn more and more. Of course, having the Loyalty Serverless magicians I could reach out to daily made things even sweeter.

Reading through the solution design helped me to understand the separation of the different architectural pieces and how they all work together.

Time to get my hands dirty

Photo by Markus Spiske on Unsplash

It wasn’t long until I was assigned a Jira ticket that would see me contribute to the codebase. I was tasked with implementing functionality to allow for the resending of an email to verify a user account. I was excited to use what I’d learned so far from my courses to get stuck into some real engineering work.

Pairing with a fellow squad member helped me get to grips with the scope of the ticket and the work that needed to be done. It was during this work that again made me realise just how many moving parts there are within a Serverless architecture.

At first, this spun me around like a Dead or Alive song but after taking a step back and studying the solution design the fog began to lift. Reading through the solution design helped me to understand the separation of the different architectural pieces and how they all work together.

If we jump forward to the present day, I’m currently in my fifth month at the LEGO Group and I am feeling much more comfortable tinkering with various different Serverless technologies. I have recently been tinkering with AWS Amplify and Appsync which has been quite fun.

While they’re not perfect and have some quirks (looking at you especially Amplify) they feel somewhat magical in what they allow you to achieve. Running a few CLI commands and provisioning resources like Lambda functions, Cognito User Pools, and other goodies is pretty damn cool. The fact that I actually understand what these things are now I think is also pretty damn cool.

What’s my point?

Photo by Tim Mossholder on Unsplash

So, you might be sitting there having read through all the things I’ve babbled about so far in this post thinking to yourself ‘What exactly is the point of all this?’. If so, there are two main things I wanted to share with this post.

Firstly, I just wanted to share my experience of the transition from a frontend focussed engineer to a more full-stack/serverless orientated engineer. Hopefully, I have been able to provide some insights into my experience of the process that may help either yourself or your team.

Secondly, I wanted to provide some words of encouragement to anyone that has made it both this far through the post and to any other newcomers to the Serverless world.

The world of Serverless looks big and scary with lots of acronyms and big words being thrown around. I’m now around five months into my Serverless journey and I’m really enjoying it.

I’m learning every day and growing as an engineer. If I am capable of learning and progressing with this Serverless magic, anyone is!

--

--

Lee Priest
Engineers @ The LEGO Group

Engineer at The LEGO Group | Serverless | AWS Community Builder | Energy drink addict