Company
Date Published
April 5, 2024
Author
Stephen Siegert
Word count
1922
Language
English
Hacker News points
None

Summary

This post explains how to create a global serverless Nuxt SSR application that leverages Cloudflare Hyperdrive and Neon Postgres. The architecture uses a client request to make a query to the Neon database via a Cloudflare Worker configured with the Hyperdrive binding, which then executes or returns a cached response from Hyperdrive. This setup optimizes access to data globally, regardless of user location. The solution utilizes Drizzle ORM to connect to Neon databases and provides two integration options: using the Neon Serverless driver directly in Nuxt server routes or deploying a Worker with the Hyperdrive configuration accessible through the Drizzle Postgres HTTP Proxy driver. The post assumes familiarity with Cloudflare, Drizzle, and Nuxt and requires a Neon Postgres account and a Cloudflare Workers Paid plan for access to Hyperdrive functionality.