Engineering18 November 2025

WhyWeChoseEffect-TSforOurEntireBackend

Type-safe errors, dependency injection, and structured concurrency — how Effect-TS changed the way we build services.

Why We Chose Effect-TS for Our Entire Backend

Two years ago we rewrote our backend from vanilla TypeScript to Effect-TS. It was a bet — Effect was still maturing, the ecosystem was small, and the learning curve was steep. Today, every service, every Lambda, every store in our monorepo is written with Effect. Here is why we are never going back.

The Problem with Try/Catch

In vanilla TypeScript, errors are invisible. A function returns Promise<User> but can throw NetworkError, ValidationError, NotFoundError, or anything else. The caller has no idea. With Effect, the signature tells the full story: Effect<User, NetworkError | NotFoundError, UserService>. Every failure mode is visible, composable, and checked at compile time.

Dependency Injection That Scales

Effect's Layer system replaced our dependency injection framework entirely. Services declare their dependencies in the type signature, and the Layer system wires everything together at the composition root. Testing is trivial — swap a real DynamoDB layer for an in-memory mock, and the types guarantee the mock satisfies the same contract.

Structured Concurrency

Running parallel operations with proper cancellation and cleanup is notoriously hard. Effect's fiber-based concurrency model handles this elegantly. We fan out API calls with Effect.all, race between timeout and computation with Effect.race, and know that resources are always cleaned up — even on cancellation.

The Learning Curve

We will not pretend Effect is easy to learn. The first two weeks are rough — generators, pipes, layers, and services feel alien if you are coming from imperative TypeScript. But once the mental model clicks, productivity surges. Engineers who struggled with async error handling in the old codebase now ship features faster with fewer bugs.

Results After Two Years

Our production incident rate dropped by roughly 70%. Time to debug issues went from hours to minutes — the typed error channel and tracing spans make root cause analysis almost mechanical. New engineers onboard faster because the types document the system better than any wiki page. Effect-TS is not a silver bullet, but for our team and our scale, it has been transformative.

Have a Project in Mind?

We build custom AI agents, distributed systems, and digital platforms. Tell us what you're working on.

More Articles