Blog

What Lambda Was Hiding: Moving Our Journal Entry Services to Containers

November 23, 2026

This year we moved the five services behind FloQast’s Journal Entry Management from AWS Lambda to containers, without changing what customers see during the close. Packaging the code was easy. The hard part was everything Lambda had been quietly doing for us.

This is the first in a series from FloQast Engineering on the platform work behind the close: the infrastructure that keeps accounting teams fast and reliable at month-end, and that now also carries FloQast’s AI agents. We start with Journal Entry Management.

By Shriganesh Shintre, Principal Engineer with Braden Godley, Software Engineer II

Journal Entry Management (JEM) is where accounting teams create, review and post journal entries in FloQast. The Close finishes when the last Journal Entry posts. Accruals, reclasses, allocations and reversals are how the general ledger reaches a closeable state, so journal entry throughput is the critical path of every close. Journal entries are also a primary control. Every entry needs documented preparation, review and approval, and JEM enforces that through workflow and automation and keeps the audit trail. Entries spike in the first days of the close, and every one has to post reliably to the general ledger, so resilience, performance and scale are requirements for JEM, not nice-to-haves. Downtime or a failed post can delay the close.

JEM runs on five services: an HTTP API and four background workers for file processing, exports, notifications and data sync. All five ran on AWS Lambda. Over a few months, we moved them to Amazon ECS on AWS Fargate, one region at a time, until each served 100% of production traffic.

Why move

  • Time limits. Lambda stops every invocation at 15 minutes. As FloQast grew, so did our customers’ data, and large imports, exports and syncs started pushing against that ceiling. In a close, an entry that can’t finish processing can’t post on time, so we wanted work to run to completion instead of racing a hard stop.
  • Cold starts. JEM’s API is interactive. Preparers and reviewers work through entries one after another during the close, and every request that hits a cold function adds a pause to their critical path.
  • Traffic from AI agents. People clicking through the app are no longer JEM’s only callers. FQ Assistant already works with journal entries through JEM’s MCP server, and every call lands on the same JEM API. An agent can make many data-heavy calls in a conversation, and that traffic is likely to grow faster than our user count. We wanted the API on a platform where extra demand is met by adding capacity, so agent calls don’t slow down the accountants closing the books.
  • Cost. For steady traffic, always-on containers are often cheaper than per-request pricing.

Same code, two compute targets

We didn’t rewrite anything, and that was deliberate. For customers, nothing about how they prepare, review, approve or post journal entries changed: same features, same workflow, same audit trail. Moving the code unchanged was the fastest way off Lambda’s limits, and it kept platform risk separate from any product change. A redesign can come later on the new platform.

Each container is built from the same source as its Lambda function, with a small HTTP adapter that runs the existing handler in a long-lived server. The same code could always serve a request on either platform.

For the API, the load balancer splits traffic between Lambda and ECS by weight. Every region started with 10% of its traffic on containers, then stepped through 30%, 60% and 100%. Rolling back meant changing a weight, not reverting code.

Figure 1

Figure 1: The API moves by weight at the load balancer. Workers move by switching the queue's consumer.

Lesson 1: Lambda was hiding concurrency bugs

A Lambda instance handles one request at a time. A container handles many. Any state kept at module level is suddenly shared between requests.

We found two cases:

  1. A shared library, two dependencies deep, kept a module-level flag marking internal-service requests. Under concurrency, one request's flag leaked into another, which showed up as intermittent 403s and was a security concern.
  2. Our localization library stored the active language globally, so concurrent requests raced: request A set French, request B set Dutch (overwriting A’s setting), and both got Dutch. This one worried me more than the 403s. A user would see labels or messages in the wrong language, and because JEM stores translated text, the wrong language could also be saved into records that reviewers and auditors read later. Fixing that in the middle of a close would have meant a data migration, not just a redeploy.

Both were caught in testing or early in the rollout, and fixed before the API took full traffic.

Figure 2

Figure 2: Module-level state leaking between concurrent requests.

‍

The fix for both was the same: data that belongs to a request has to travel with that request, not sit in the process. Node.js has a built-in tool for this, AsyncLocalStorage. It gives each request its own store that follows it through every await and callback, so code deep inside a library can still ask “which request am I serving?” and get the right answer. Our HTTP adapter already opened a store at the start of every request to hold the user’s identity. We moved the internal-service flag into that same store. Every service running behind the adapter picked up the fix without changing its own code.

The language bug needed more care. Dozens of call sites used the translation function directly, and changing each one would have been slow and easy to get wrong. Instead, each request now gets its own read-only language setting, and we hooked the translation library at the single point every call passes through, so every existing call uses the request’s language without being touched. Before the fix, for a load test, about 40% of responses came back in the wrong language under concurrent load. Now, we have an integration test (blocking PR merges) which sends requests in different languages at the same time and fails if any response comes back in the wrong one.

Then I asked a bigger question: which other services had the same bug? I went through every HTTP service we were moving to containers and found a handful. Because we caught it before any of them were live on containers, the shared fix covered them all before their cutovers.

Lesson 2: Scaling on CPU is too late

Our standard policy scaled on CPU and memory. Memory never got close to its threshold, and CPU only rises after requests start queuing. Under load we saw slow responses and bursts of 502s at the start of each spike.

I fixed it in layers:

  • Tuned the HTTP adapter's keep-alive and request timeouts, a common source of 502s behind a load balancer.
  • Shortened cooldowns, tuned health checks and lowered the CPU target.
  • Tuned scale-in so the service gives capacity back when traffic drops.
  • Most importantly, added scaling on request rate per task, so new tasks start earlier in a spike instead of after requests have queued.

A load test at six times our current peak, enough for more than two years of growth, confirmed the service scales out and back in. Also we observed that, importing and saving 500-line journal entries stayed under half a second at the 95th percentile, with no errors.

Close timing is shared. Many customers close in the same few days, so demand on JEM rises for everyone at once. In our busiest region, request volume during close week runs about two and a half times a normal week (Figure 3), and we sized for that peak, not the average. Capacity follows demand: new tasks start as request rate climbs, the minimum fleet carries a normal day, and during recent closes the API scaled out to roughly twice its minimum size and back in afterwards.

Lesson 3: Build dashboards and alerts before the first test

I built the dashboards while we were still testing. They turned load tests and bug-bashes into evidence: we could watch Lambda and container performance side by side, compare error rates, and confirm the service scaled out as traffic climbed.

  • One dashboard per service for requests, failures, CPU, memory and running tasks. The JEM API’s dashboard became the template for every other service.
  • Metrics in test environments too. The environments we used to check scaling had no task-level metrics until I turned them on. Without them, we couldn’t have shown that autoscaling worked before production.
  • Compare like with like. We compared both platforms over the same window, because month-end close shifts traffic too much for last month’s numbers to mean anything.
  • Alerts from the first test. We began with simple email alerts on errors and slow responses, so a scheduled load test caught problems even when no one was watching the dashboard. By the time traffic moved to production, we already knew which alerts were useful and which were noise.

Figure 3: Daily API traffic over four weeks, relative to a normal week. Month-end close brings about two and a half times the usual load.

Measuring the impact

What this means for a close: the steps a journal entry takes through JEM now run on capacity that grows with the close, instead of a platform that slows at the peak.

With all five services at 100%, we compared containers with Lambda in our largest production region serving real customer traffic:

Measure Containers vs Lambda
Compute cost, same traffic (estimated)about 23% lower
Latency, same traffic (p50 / p95 / p99)18% / 8% / 18% faster
5xx errors per request, same monthabout half the rate
5xx errors, side by side on the same trafficno measurable difference

Compared with Lambda, containers were faster and an estimated 23% cheaper. Note that the cost gap should widen as traffic grows.

Closing thoughts

Moving from Lambda to containers looks like a packaging change. In fact, it changes the contract your code runs under: one request at a time becomes many, and scaling becomes your job. If I had to pick one habit, it’s looking for shared state before you move, not after.

We also built for traffic JEM doesn’t have yet. With AI agents now calling it, we load-tested for more than two years of expected growth and made the service scale on requests, not just CPU.

Thanks to the JEM engineering and QE teams, who tested and bug-bashed every step with us.

About the Author

‍Shriganesh Shintre is a Principal Engineer at FloQast who led the move of FloQast’s journal entry services from AWS Lambda to containers and now builds the infrastructure behind FloQast’s AI agents.