In this article we are going to see the reason that made us change our backend
to Fly.io and the challenges we had during the migrations.
We chose Hono as our API server with Bun
as the runtime and pick Fly.io as your hosting service.
š¤ Why did we want to move our backend from Vercel?
ā” A lightweight Server
We required a lightweight server with a simple REST API for our monitoring
endpoint. Deploying a simple Express server is possible, but it is not
specifically designed for this purpose.
It's possible to deploy an Express.js application as a single Serverless Function, but it comes with drawbacks and should only be used as a migration path. Instead, use Next.js or embrace multiple Serverless Functions as you incrementally migrate to the Vercel platform.
Also launching a clean and new Next.js server takes 2.5 seconds on my MacBook
Pro M1 and takes 110mb of RAM, and it includes unnecessary extra features from
Next.js. Our prod Next.js app takes about 5 seconds to launch on my computer
(contentlayer).
For comparaison launching our current server takes 0.19ms and only takes 91mb.
Our current server stack is Hono + Bun.
šø Pricing
We initially aimed to provide multi-region monitoring for all users while
maintaining a free tier. On Vercel, if you want a multi-region function, you
need to opt for Edge Functions. Edge functions are cost-effective as you only
pay for the actual CPU execution. This means that you won’t be billed for idle
times when fetching data.
It’s st