Skip to main content

DevFest Triângulo 2023

· 6 min read
Bruno Carneiro
Fundador da @TautornTech

On December 2nd, 2023, Dev Fest Triângulo 2023 took place — a global technology event organized by the Google Developer Group (GDG) community. This year's event was held in Uberlândia, Minas Gerais, and had more than 900 participants including students, professionals, and technology enthusiasts.

I had the pleasure of sharing a bit of my knowledge about Serverless and how AWS can help us create scalable and resilient applications at very low cost. I also demonstrated a migration case from Base39.

It was an incredible day with many talks, knowledge exchange, high energy, and lots of networking.

I had the opportunity to speak about Serverless — the technology we use at Base39 that helps us maintain and scale our applications.

We have been working with Serverless for more than 4 years and have a lot of experience to share. Here is a bit of what I presented at DevFest Triângulo 2023.

info
Today: 80% of developer time is operations and maintenance. In the future, the only code you will write is your business logic. Source: Deloitte: 2019

What is Serverless?

Serverless is a computing model that allows us to run code in a cloud without the need to manage servers. E.g.: AWS Lambda, Google Cloud Functions, Azure Functions, etc.

This way, the development team does not need to worry about infrastructure and can focus on what matters: the business.

With this, we can replace servers with managed services.

tip

Learn more at: Serverless Track.

Architecture using Kubernetes:
Architecture using managed services:

Notice that in the second image we have the Serverless concept. It is a much faster and simpler way to work — not to mention it can also be more economical.

Serverless allows the client to focus on business value

Agility, performance, security, cost, and much more. These are crucial points for the success of a project. And Serverless helps us achieve all of them.

Agility: It is very simple to provision a service. In just a few minutes we can deploy and put into production.

Performance: Since we do not need to worry about performance, we can focus on writing quality code that meets business needs. The cloud is responsible for infrastructure management and scaling.

Security: We can work with the concept of "least privilege," meaning each service has only the permissions necessary to perform its function. Additionally, we can use security tools such as AWS Shield, which helps protect our applications against DDoS attacks.

Cost: The costs to operate a Serverless service are low. Pay as you go is the billing model used. The billing model is per request and execution time. If no one is using the services, the charge is zero.

What are customers building with Serverless?

  • IT Automation: Resource provisioning, backups, scripts, and much more;

  • Web Applications: APIs, websites, SaaS systems, edge APIs;

  • IoT Applications: Data collection, data processing, data analysis;

  • Data Processing: ETL, log processing, real-time data processing;

  • Machine Learning Applications: Model training, model inference, image processing, natural language processing;

Serverless is more than compute

Some GCP (Google Cloud Platform) tools that can help us create Serverless applications:

  • Cloud Functions: Serverless functions that respond to events;
  • Cloud Run: Runs serverless containers;
  • Cloud Tasks: Serverless task orchestration;
  • Cloud Scheduler: Serverless task scheduling;
  • Cloud Pub/Sub: Serverless messaging;
  • Cloud Storage: Serverless storage;
  • Cloud SQL: Serverless database;
  • Cloud Datastore: Serverless data storage;
  • Cloud Armor: Serverless DDoS protection;
  • Cloud Key Management Service: Serverless key management;

Learn more at: GCP

When not to use Serverless?

  • Real-time transaction processing systems;
  • Applications that require high processing power;
  • Applications that require high storage capacity;
  • Online gaming applications;
  • Video streams;
  • Industrial control systems;
  • Air traffic control systems;
  • Synchronous businesses.

These are some examples of applications for which a Serverless architecture is not recommended. They may have issues with latency, cost, and performance.

Serverless Architecture Patterns

Event

Something that happens particularly of importance or noteworthiness. Invocation data sent to the function. The format differs according to the event source.

Lambda function

Function that runs when an event occurs (handler). Processes the input event.

Context

Additional information from the Lambda service. E.g.: request ID, execution time, memory limit, etc.

Anatomy of a lambda function:

Base39 Case

warning

I am still writing this case — I will separate it into another article so it does not get too long.

Conclusion

Serverless is an excellent technology for scaling applications and reducing costs. But it requires care when using it. You need to understand the business and what you want to achieve. In addition, you need to have good knowledge of architecture and good development practices. Technology is not a silver bullet and depending on how it is used (like any technology) it can bring more problems than solutions. Study extensively how serverless works — the paradigm is different from using other technologies that involve server management. Many people end up having problems because they do not understand how serverless works and end up using it the wrong way.

As mentioned earlier, not every application should use this approach, and it may have the opposite effect to what is expected. Therefore, it is important to understand the business and what you want to achieve.

At Base39 we use it in 100% of our services and do not intend to change technology. It is important to note that we do not scale only with lambda function, but with a series of other AWS resources that make up our architecture and are also serverless (without infrastructure management).

If you want to see the presentation, you can access the link: Presentation slides

Thanks!