Case study · Stack

How Conta Azul runs a small business ERP on AWS

Conta Azul is an online ERP that handles finances, sales and invoicing for Brazilian small businesses and their accountants. It runs on AWS, pairs a Java legacy with newer Go services, and serves thousands of per-customer ML models through Amazon SageMaker.
Copy this stackcontaazul.com Online ERP for small businesses and accountants · Brazil · founded 2011

Conta Azul's stack

Open in the stack builder

Language

  • Pythonaws.amazon.com

    Language of the data science and inference code.

  • Javagithub.com

    Language of the older code base, built with Maven.

Hosting

  • AWScontaazul.com

    Hosts the ERP, with ISO 27001 and PCI DSS certifications.

  • Kubernetes (Amazon EKS)aws.amazon.com

    Ran model inference in pods before the move to SageMaker.

  • Dockeraws.amazon.com

    Packages the custom inference container on the SageMaker Inference Toolkit.

    Why: They needed extra dependencies and custom inference logic.

Login

Backend framework

  • AWS Lambdaaws.amazon.com

    Routes each prediction to the customer's model, falling back to the global one.

  • Goarc.dev

    Language for new backend microservices.

AI model

  • Amazon SageMakeraws.amazon.com

    Serves thousands of per-customer models that categorize financial entries.

    Why: Multi-Model Endpoints serve thousands of models from one container and handle loading and caching for them.

Error monitoring

  • New Relicgithub.com

    Application performance monitoring.

  • Prometheusgithub.com

    Collects metrics, including New Relic data through the team's own exporter.

How they built it

An ERP on AWS with an open API

Conta Azul says its ERP runs on AWS servers with ISO 27001 and PCI DSS certifications and automatic backups.

Partners plug in through a public REST API that exchanges JSON and authenticates with OAuth 2.0, covering finance, customers, products, sales and invoices. The company also publishes an n8n node on GitHub so customers can automate those flows without writing code.

Sources:contaazul.com developers.contaazul.com github.com

From EKS pods to SageMaker

Conta Azul suggests a category for each financial entry using one model per customer, plus a global fallback. Those thousands of models used to be served from pods on Amazon EKS, where loading several versions caused out-of-memory errors and every update meant restarting all the pods.

In 2021 the data science team moved inference to SageMaker Multi-Model Endpoints, which load and cache models on demand from a single custom container. A Lambda function routes each request to the right customer model, and autoscaling handles peaks of more than a thousand requests per minute.

Sources:aws.amazon.com

Java roots, Go for new services

The company's GitHub shows its Java roots, including a Docker image with Oracle JDK 6 and Maven and a fluent date library for Java. Newer backend openings focus on Go and ask engineers to design scalable microservices with REST, GraphQL and gRPC.

The team also wrote a small Go exporter that pulls New Relic application metrics into Prometheus.

Sources:github.com github.com arc.dev github.com

Retiring the classic ERP

About 800 customers, many of them since 2012, still used the old Clássica version, built on technology that no longer fit with the modern platform. The team spent almost three months building a migration engine, moved everyone in batches to limit risk and removed about 175,000 lines of code.

Sources:medium.com

Also detected on their website

Found on the homepage with the open Wappalyzer rules (HTML, scripts and headers). It shows what runs in the browser, not the whole backend.

  • Amazon CloudFront
  • Amazon S3
  • Amazon Web Services