From 1 to 101 Lambda Functions in Production: Evolving a Serverless Architecture

Rate this content
Bookmark

FAQ

Vacation Tracker is a system designed to track leave requests and the number of remaining PTO days. It integrates with Slack and Microsoft Teams, allowing users to see leave information directly within these platforms and even request or approve leaves using simple commands or buttons.

Vacation Tracker adopted a serverless architecture primarily because it offered auto-scaling, auto-failover capabilities, and cost efficiency, which were crucial for their small startup team that lacked extensive DevOps experience. Serverless allowed them to build prototypes quickly and focus on functionality without managing server infrastructure.

The main challenges included managing and scaling a growing number of Lambda functions, integrating new features with existing server-based and serverless components, and transitioning from a mixed architecture to a fully serverless solution.

Vacation Tracker's architecture evolved through several phases, from a simple serverless bot to a more complex system using AWS services like Lambda, API Gateway, and DynamoDB. They implemented CloudFormation for infrastructure management and adopted an event-driven architecture with CQRS to better handle state and events.

Testing and monitoring are crucial for ensuring the reliability and efficiency of Vacation Tracker's serverless architecture. They employ a range of strategies including unit and integration testing, using real AWS resources for accurate results, and maintaining robust monitoring systems to quickly respond to issues.

Despite the generally low cost of serverless, Vacation Tracker keeps a close eye on their AWS usage to manage expenses effectively. They experienced a significant cost from a single bug related to DynamoDB usage, underscoring the importance of careful resource management and debugging practices.

Vacation Tracker addresses onboarding challenges by assigning developers their own AWS environments, allowing them to learn by directly interacting with a replica of the production system. This hands-on approach helps new developers understand the serverless components and architecture incrementally.

Slobodan Stojanović
Slobodan Stojanović
32 min
24 Jun, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Vacation Tracker is a serverless startup using Node.js that started with a simple lambda function and now has many lambda functions. They built a system connected to Slack and calendars, which is now used by many startups, companies, and organizations. They evolved to an event-driven architecture using CQRS and AWS AppSync with Managed GraphQL. Onboarding new developers is a challenge, but serverless allows them to assign a new environment and AWS account to each developer. Testing and monitoring are crucial, and they have successfully migrated from MongoDB to DynamoDB.

1. The Story of Vacation Tracker

Short description:

Hello! I'll tell you a story about Vacation Tracker, a serverless startup using Node.js. It all started with a simple lambda function, and now we have many lambda functions. In 2016, we decided to solve our own problem of tracking leave and remaining days. In 2018, we received requests for a private beta and decided to build a system connected to Slack and calendars. Many startups, companies, and organizations now use our system.

♪♪ Hello! I'll tell you a story about serverless startup. The serverless part is definitely not the most important part of our startup, but on the other side, it's really cool story for someone that is a programmer and working with Node.js and other technologies.

So I'll tell you a story about Vacation Tracker. As I said, at the moment we are 100% serverless startup using Node.js, but everything started with a simple lambda function. Then we added another and another and another. And yeah, that escalated quickly. So now we have a lot of lambda functions, and I'll try to walk you through our story from the first lambda function to the current state in production, and we started more than three years ago.

So first in 2016, we decided to build a live tracking system. Actually, I'm lying. We decided to solve our own problem because our other company, Cloud Horizon, had more than 10 people at that moment. And it was really hard to track who's off, how many PTO days they have remaining for this year, and things like this. We built... We tried to do internal Hackathon, and as every Hackathon, we didn't build anything. So in 2017, we tried to build, to solve our own problem. We tried to find some other live tracking tools, but most of them were like complex HR systems and things like this. So we decided to build something in-house, and we'll build up some kind of proof of concept with Slack. And as always, we decided not to continue at that moment, but we published the landing page.

In 2018, we got a lot of requests through our landing page, more than a hundred people waited in the waiting lists for a private beta, so we finally decided to build something. The idea was really simple. We wanted a system that will track leave requests and the number of remaining days. We wanted to use some kind of single sign on so we don't need to remember more passwords. I hate passwords. We wanted something to be connected to our Slack so we can see the info when we need the info. For example, when someone is not working, we want to see like that person is on vacation and things like this. And finally, we wanted to connect our calendar so we can subscribe to events and see who will not work next month and things like this.

As I said, we were solving our own problems and we don't know if anyone else will use our system but a few months after we released the beta version, we saw that there are many startups that want to use our system. And then we saw some small companies signing up and then some schools and universities and then nonprofits and then teams from many enterprises. And then we saw some government organizations and we saw some other organizations such as churches and many other organizations that they never thought will use the system like this. So there was a real problem and we decided to continue with that idea. And today we have many customers from many large and famous companies and also many cool startups and smaller companies and organizations.

2. The Product and Serverless Architecture

Short description:

The number of unique users in our system on December 1st was this. Here's the product: Web Dashboard for quotas and locations, Slack integration for leave requests, and Microsoft Teams integration with embedded dashboard. Our first architecture was a simple serverless bot, version 0.1. Let me introduce myself: I'm Slobodan Stojanovic, CTO of CloudHorizon and Vacation Tracker. We chose serverless because of auto-scaling, auto-failover, and cost-effectiveness. It was fast to build a prototype using serverless.

The number of unique users in our system on December 1st was this. Not all of these users are using Vacation Tracker but all of these users went through Vacation Tracker at some point. It's a nice number, but it was a real number that I took from our database. I decided to leave this number from December 1st because I'm pretty sure I will not be able to get this nice number again.

So here's the product. We have Web Dashboard where you can do many things like see the quotas and set up locations and many other things. For Slack users, we also have a nice integration where you can just click on one button or do a slash vacation command and request or approve the leave. For Microsoft Teams, we have the same thing plus some nice cool things such as embedded dashboard inside Microsoft Teams so you don't need to log into a separate system and things like this. But let's talk about interesting things and that's architecture not the system itself.

So our first architecture was a simple serverless bot. This was version 0.1 because this was better and we didn't know if anyone would use our system. So the bot looked something like this. It was really funny because there was no calendar or anything like that inside Slack so we built everything with buttons, but it seems that that was better than Excel spreadsheets and many other things that people are using to track their leaves. And whenever you click on this button or anything like that, it triggers some serverless bot in the background.

So why serverless? That's the obvious first question. Well, this talk is about scaling a serverless startup from 1 to 10001, not 1000 yet. 101 Lambda functions in production, so that's why. I'm just kidding, of course, but now that they stopped the flow, let me introduce myself. I'm Slobodan Stojanovic. I'm CTO of CloudHorizon and also CTO of this product, Vacation Tracker. I'm also co-author of Serverless Applications with Node.js book, which I wrote with my friend Aleksandar Simovic. And I'm also AWS serverless hero. I'm writing a lot about serverless and you can see more articles on my website. There are links to many other websites where I write about serverless. But let's go back to the most important question, why serverless? As you probably know, serverless is an acronym for something like slow, expensive, vendor locking, and I'm obviously kidding, that's not true. I actually really love serverless and we decided to build everything with serverless because at the moment we started this, we were a small team, we are still a small team, and our team was not really experienced with DevOps. So we decided to use something that has auto-scaling and auto-failover links like this. We tried to go as cheap as we can because we bootstrapped our startup so serverless fits that nicely because it's cheap. And it was really fast to build a prototype using serverless. It took us a few days to build that chatbot with that fake calendar and everything.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Node Congress 2022Node Congress 2022
26 min
It's a Jungle Out There: What's Really Going on Inside Your Node_Modules Folder
Top Content
The talk discusses the importance of supply chain security in the open source ecosystem, highlighting the risks of relying on open source code without proper code review. It explores the trend of supply chain attacks and the need for a new approach to detect and block malicious dependencies. The talk also introduces Socket, a tool that assesses the security of packages and provides automation and analysis to protect against malware and supply chain attacks. It emphasizes the need to prioritize security in software development and offers insights into potential solutions such as realms and Deno's command line flags.
Towards a Standard Library for JavaScript Runtimes
Node Congress 2022Node Congress 2022
34 min
Towards a Standard Library for JavaScript Runtimes
Top Content
There is a need for a standard library of APIs for JavaScript runtimes, as there are currently multiple ways to perform fundamental tasks like base64 encoding. JavaScript runtimes have historically lacked a standard library, causing friction and difficulty for developers. The idea of a small core has both benefits and drawbacks, with some runtimes abusing it to limit innovation. There is a misalignment between Node and web browsers in terms of functionality and API standards. The proposal is to involve browser developers in conversations about API standardization and to create a common standard library for JavaScript runtimes.
ESM Loaders: Enhancing Module Loading in Node.js
JSNation 2023JSNation 2023
22 min
ESM Loaders: Enhancing Module Loading in Node.js
ESM Loaders enhance module loading in Node.js by resolving URLs and reading files from the disk. Module loaders can override modules and change how they are found. Enhancing the loading phase involves loading directly from HTTP and loading TypeScript code without building it. The loader in the module URL handles URL resolution and uses fetch to fetch the source code. Loaders can be chained together to load from different sources, transform source code, and resolve URLs differently. The future of module loading enhancements is promising and simple to use.
Out of the Box Node.js Diagnostics
Node Congress 2022Node Congress 2022
34 min
Out of the Box Node.js Diagnostics
This talk covers various techniques for getting diagnostics information out of Node.js, including debugging with environment variables, handling warnings and deprecations, tracing uncaught exceptions and process exit, using the v8 inspector and dev tools, and generating diagnostic reports. The speaker also mentions areas for improvement in Node.js diagnostics and provides resources for learning and contributing. Additionally, the responsibilities of the Technical Steering Committee in the TS community are discussed.
You Don’t Know How to SSR
DevOps.js Conf 2024DevOps.js Conf 2024
23 min
You Don’t Know How to SSR
The Talk covers the speaker's personal journey into server-side rendering (SSR) and the evolution of web development frameworks. It explores the use of jQuery for animations in SSR, the challenges faced in integrating React with Umbraco, and the creation of a custom SSR framework. The Talk also discusses the benefits of Next.js and the use of serverless artifacts for deployment. Finally, it highlights the features of Astro, including its function per route capability.
Node.js Compatibility in Deno
Node Congress 2022Node Congress 2022
34 min
Node.js Compatibility in Deno
Deno aims to provide Node.js compatibility to make migration smoother and easier. While Deno can run apps and libraries offered for Node.js, not all are supported yet. There are trade-offs to consider, such as incompatible APIs and a less ideal developer experience. Deno is working on improving compatibility and the transition process. Efforts include porting Node.js modules, exploring a superset approach, and transparent package installation from npm.

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
Node.js Masterclass
Node Congress 2023Node Congress 2023
109 min
Node.js Masterclass
Top Content
Workshop
Matteo Collina
Matteo Collina
Have you ever struggled with designing and structuring your Node.js applications? Building applications that are well organised, testable and extendable is not always easy. It can often turn out to be a lot more complicated than you expect it to be. In this live event Matteo will show you how he builds Node.js applications from scratch. You’ll learn how he approaches application design, and the philosophies that he applies to create modular, maintainable and effective applications.

Level: intermediate
Build and Deploy a Backend With Fastify & Platformatic
JSNation 2023JSNation 2023
104 min
Build and Deploy a Backend With Fastify & Platformatic
WorkshopFree
Matteo Collina
Matteo Collina
Platformatic allows you to rapidly develop GraphQL and REST APIs with minimal effort. The best part is that it also allows you to unleash the full potential of Node.js and Fastify whenever you need to. You can fully customise a Platformatic application by writing your own additional features and plugins. In the workshop, we’ll cover both our Open Source modules and our Cloud offering:- Platformatic OSS (open-source software) — Tools and libraries for rapidly building robust applications with Node.js (https://oss.platformatic.dev/).- Platformatic Cloud (currently in beta) — Our hosting platform that includes features such as preview apps, built-in metrics and integration with your Git flow (https://platformatic.dev/). 
In this workshop you'll learn how to develop APIs with Fastify and deploy them to the Platformatic Cloud.
Building a Hyper Fast Web Server with Deno
JSNation Live 2021JSNation Live 2021
156 min
Building a Hyper Fast Web Server with Deno
WorkshopFree
Matt Landers
Will Johnston
2 authors
Deno 1.9 introduced a new web server API that takes advantage of Hyper, a fast and correct HTTP implementation for Rust. Using this API instead of the std/http implementation increases performance and provides support for HTTP2. In this workshop, learn how to create a web server utilizing Hyper under the hood and boost the performance for your web apps.
0 to Auth in an Hour Using NodeJS SDK
Node Congress 2023Node Congress 2023
63 min
0 to Auth in an Hour Using NodeJS SDK
WorkshopFree
Asaf Shen
Asaf Shen
Passwordless authentication may seem complex, but it is simple to add it to any app using the right tool.
We will enhance a full-stack JS application (Node.JS backend + React frontend) to authenticate users with OAuth (social login) and One Time Passwords (email), including:- User authentication - Managing user interactions, returning session / refresh JWTs- Session management and validation - Storing the session for subsequent client requests, validating / refreshing sessions
At the end of the workshop, we will also touch on another approach to code authentication using frontend Descope Flows (drag-and-drop workflows), while keeping only session validation in the backend. With this, we will also show how easy it is to enable biometrics and other passwordless authentication methods.
Table of contents- A quick intro to core authentication concepts- Coding- Why passwordless matters
Prerequisites- IDE for your choice- Node 18 or higher
GraphQL - From Zero to Hero in 3 hours
React Summit 2022React Summit 2022
164 min
GraphQL - From Zero to Hero in 3 hours
Workshop
Pawel Sawicki
Pawel Sawicki
How to build a fullstack GraphQL application (Postgres + NestJs + React) in the shortest time possible.
All beginnings are hard. Even harder than choosing the technology is often developing a suitable architecture. Especially when it comes to GraphQL.
In this workshop, you will get a variety of best practices that you would normally have to work through over a number of projects - all in just three hours.
If you've always wanted to participate in a hackathon to get something up and running in the shortest amount of time - then take an active part in this workshop, and participate in the thought processes of the trainer.