Should I migrate my multi-country directory from Next.js to a Cloudflare-based stack?
Asked by
banjo beginner
I run a directory that currently covers one country, and I'm planning to expand it to include listings from several countries. The app uses Next.js and includes login, signup, reviews, bookmarks, and other user-submitted data. It currently runs on a Singapore VPS, but I'd rather avoid renting separate servers for each region or moving everything to AWS.
I'm considering Cloudflare Workers and frameworks or adapters such as OpenNext, Vinext, TanStack, or RedwoodSDK. However, I'm unsure whether the newer options are mature enough for production. Most directory pages change infrequently because they cover news, parking lots, and EV charging stations, but user features still need dynamic requests. Has anyone made a similar migration, and was it worthwhile?
Answers
Before migrating, test the actual slow path from the countries you want to support. If reviews, bookmarks, or bookings still write to one database, moving the frontend closer to users may not reduce much latency because those requests still need to make the database round trip. Public country and listing pages are better candidates for edge caching, while user actions can remain centralized.
Reply to this answer
Iโd avoid changing the whole stack for this. Keep Next.js on the existing VPS and put Cloudflare in front as a CDN. One server can serve users in multiple countries, especially if the mostly static directory pages are cached at the edge. Keep the database centralized and add a country field to your data model. The migration effort probably wouldnโt justify the gains.
Reply to this answer
I moved an older Next.js app to Vinext and Cloudflare, and the transition was fairly painless. It didnโt require many code changes, although I wouldnโt assume every application will be that straightforward.
Reply to this answer
TanStack worked better for my move to Cloudflare. OpenNext can become awkward with more complex applications and partial prerendering, while Vinext still felt like a risk for a production-critical project. That said, the lower-risk approach is probably to keep your current framework, cache the rarely changing pages, and expose the dynamic features through a small API. If you do move to Workers, authentication and session handling are likely to be more troublesome than rendering.
Reply to this answer
Add your answer
Answers are reviewed before publication.
!RefillThePitcher: Have you run into any production issues since the migration, particularly with authentication, sessions, or less common Next.js features?