Vercel and TiDB Cloud Starter: The Full-Stack Playbook for AI Apps TiDB Cloud Starter connects to Vercel serverless and edge functions over HTTPS via the TiDB Cloud serverless driver, eliminating the TCP connection pool that breaks traditional MySQL and Postgres databases under bursty serverless traffic. The playbook details swapping a v0.dev or Lovable starter database for TiDB Cloud Starter through a connection string change, keeping embeddings beside rows with a native VECTOR type instead of a separate vector store, and deploying through the Vercel Marketplace integration that writes connection environment variables automatically. The setup targets Vercel serverless functions on the Node.js runtime, Vercel Edge Functions, and Cloudflare Workers, where raw TCP sockets are not permitted. Key Takeaways - Edge runtimes break TCP pools. TiDB Cloud Starter connects over HTTPS instead. - Swapping a v0.dev starter database for TiDB is a connection string change. - A native VECTOR type keeps embeddings beside your rows, with no store to sync.- The Vercel Marketplace integration writes the connection variables for you. You have an AI app running on Vercel, or a prototype that v0.dev generated in a few minutes, and now it needs a real database. The choice is harder than it looks, because serverless functions and edge runtimes break the assumptions traditional databases are built on: long-lived TCP connections, a bounded pool, and a process that stays warm between requests. This playbook covers the full path. Pick a Vercel database that survives serverless and edge runtimes, model the data an AI app actually stores, put embeddings next to that data instead of in a separate vector store, connect from Vercel Edge Functions and Cloudflare Workers, and deploy through the Vercel Marketplace integration that wires the environment variables for you. TiDB https://www.pingcap.com/what-is-tidb/ is an open source distributed SQL database with transactional and analytical processing in one engine. TiDB Cloud Starter is its fully managed, auto-scaling deployment option, MySQL compatible and provisioned in about a second. Vercel https://vercel.com/home is the creator of Next.js and the platform most AI apps deploy to. The two fit together well, and the rest of this post shows exactly how. Why a Vercel App Needs a Serverless Database Built for the Edge Vercel runs your backend as serverless and edge functions rather than a long-running server, and that changes what a database has to support. A serverless function executes on demand, scales automatically, and terminates when the request finishes. A traditional API keeps a process alive behind a request-response interface, holds its connection pool open, and reuses connections across requests. Three differences matter when you pick a database: - Lifecycle. A serverless function runs a specific piece of code in response to an event and exits. A traditional API stays resident and manages its own infrastructure. - Portability. Serverless functions bind to a platform runtime. A traditional API runs anywhere you can host a process. - Deployment speed. Serverless functions ship in shorter cycles because there is no infrastructure to provision, which is why AI apps iterate on them. Connection Pooling Is the Problem Serverless Exposes Each function invocation opens its own database connection. Under bursty traffic, a few hundred concurrent invocations become a few hundred connections, and a traditional MySQL or Postgres instance starts refusing them. Teams usually respond by adding an external pooler, which adds a hop, a component to operate, and a new failure mode. TiDB Cloud Starter takes a different path with the TiDB Cloud serverless driver https://docs.pingcap.com/tidbcloud/serverless-driver/ , which talks to the database over HTTPS instead of TCP. There is no pool to exhaust because there is no persistent connection in the path. Each invocation makes an HTTPS request, gets its result, and ends. Runtimes This Playbook Covers Everything below works on three targets: Vercel serverless functions Node.js runtime , Vercel Edge Functions, and Cloudflare Workers. Edge runtimes are the strict case, because they do not allow raw TCP sockets at all. A driver that speaks HTTPS is not an optimization there. It is the only thing that connects. From a v0.dev or Lovable Prototype to a Deployed Vercel App AI builders like v0.dev and Lovable scaffold a working Next.js app in minutes, then hand you a project that expects a database URL and ships with a generic Postgres or SQLite starter. Swapping that starter for TiDB Cloud Starter takes three steps: prototype, connect, deploy. Prototype. Generate the app as usual. The output is a standard Next.js project with an API layer, a data access file, and an .env or .env.local expecting DATABASE URL . Connect. Find where the generated app reads that variable. In a Prisma project it is the datasource block in prisma/schema.prisma . In a Drizzle or Kysely project it is the client initialization file. Point it at a TiDB Cloud Starter connection string: DATABASE URL='mysql://