I Rewrote My Entire Codebase from Go to TypeScript
November 15, 2026 · 4 min read
I recently rewrote the entire Envi(envisecrets.com) backend from Go to TypeScript. For some people, that might sound like a downgrade. After all, Go is compiled, statically typed, relatively lightweight, and generally considered an excellent choice for backend infrastructure. In fact, I had no major complaints with Go. The original implementation worked just fine. The decision came from somewhere else entirely, which would be revealed later in this piece.
How it started
When I initially started building Envi(envisecrets.com), I had a Go API, a Next.js application, PostgreSQL as my primary database, and Redis for caching and other operations. For hosting, I went with a VPS running Coolify.

At the time, this seemed like the most reasonable choice. I could deploy my Go application, manage my databases, and have control over the entire infrastructure. Everything seemed to be fine, but there was an issue: The infrastructure was costing more than the product justified. Envi didn’t have much traffic. It was still relatively early, and the actual workload wasn’t particularly demanding. Yet I was paying for a VPS with 12 GB of RAM, running Coolify, my backend, PostgreSQL, and Redis. Then I started questioning whether this made any financial sense. Why was I maintaining and paying for an entire server when the application barely had any traffic?
I began looking at Cloudflare Workers. The free plan was already sufficient for Envi’s current traffic, and even moving to the paid Workers plan would cost just $5 per month. That was considerably far less than what I was spending on my VPS. Of course, there were other services to consider, particularly the database and Redis. But I realized I could move those to managed services with generous free tiers.
The performance argument
One argument people might make is that Go is faster than TypeScript. Generally speaking, that’s true in many computational workloads. Go compiles to native machine code, while TypeScript is transpiled to JavaScript and executed by a runtime. But here’s something I think developers sometimes overlook: Not every application needs the performance characteristics of its programming language to be its primary consideration.
Envi is fundamentally an application that performs a lot of reads and writes. It communicates with PostgreSQL, interacts with Redis, handles API requests, and manages environment secrets. It’s not doing computationally expensive operations that would make the difference between Go and TypeScript particularly meaningful. Even if the Go implementation were a few milliseconds faster in some operations, would that difference matter to Envi’s users?
I didn’t think so.
I’d rather spend less money operating the application than optimize for performance that my users probably wouldn’t notice. This isn’t an argument against Go. It’s an argument against optimizing for the wrong things and over engineering
Rebuilding the infrastructure
Before i started migrating the backend, i decided to first migrate the infrastructure it depended on. I started with PostgreSQL. I wrote a migration script to move the existing database from my VPS to Neon. This gave me a managed PostgreSQL database without having to worry about maintaining the database server myself. Next was Redis. I migrated it from my VPS to Upstash, which provided another managed service that fit the requirements of the application. With the databases taken care of, I could finally focus on the backend.
The rewrite
Hono + Typescript was particularly attractive because of its Cloudflare Workers support. I could build my API using a familiar TypeScript development experience and deploy it directly to Workers. I also wanted to eliminate unnecessary infrastructure complexity. The frontend was already built with Next.js, so I moved that from Vercel to Cloudflare Workers as well. Eventually, both the frontend and backend were running on Cloudflare.
For the current scale of Envi, this was a much more reasonable architecture. And when I eventually need more capacity, the Cloudflare Workers paid plan starts at $5 per month.
But Envi is also self-hostable
Envi isn’t exclusively a hosted product. It’s also designed to be self-hostable. Some users might prefer running their own infrastructure because of privacy, control, or other operational requirements. I didn’t want my decision to move to Cloudflare to take that option away. So I made sure to preserve a separate entry point for conventional deployments. The application can still be deployed using Docker or PM2 on a traditional server. I simply pointed the Cloudflare configuration to a separate entry point designed for the Workers runtime, meaning I can maintain two deployment options without forcing self-hosting users to adopt Cloudflare. I think that’s a reasonable compromise.
Result:
In the end, I had a way easier, cheaper workflow:

What can you learn from this?
One thing this experience reinforced for me is that choosing a programming language shouldn’t happen independently of your deployment strategy.
When selecting a language, developers often consider:
- Performance.
- Memory consumption.
- Concurrency.
- Ecosystem.
- Developer experience.
- Maintainability.
etc..
But I think there’s another question worth asking: Where am I going to run this software, and how much will it cost me to keep it running?
A language might be technically excellent for your application but not necessarily the most economical choice for the infrastructure you intend to use. Of course, this doesn’t mean everyone should abandon Go for TypeScript, or that serverless is always cheaper than running your own infrastructure. It means your decisions should be informed by your actual requirements. For Envi, Go was perfectly capable of doing the job. But TypeScript, Hono, and Cloudflare Workers gave me a deployment architecture that made considerably more financial sense. I didn’t rewrite Envi because Go couldn’t handle the application. I rewrote it because I realized I was spending too much money solving a problem I didn’t have.
AVOID OVER ENGINEERING!!! Let your choice of technology be based on your capability & the system requirements.