concept: connectionLess - davidkhala/database GitHub Wiki
ConnectionLess
Challenge of Serverless: Database Connections
For example, with PlanetScale/Supabase/Fauna, you can consider them "connectionless" - connecting pooling isn't an issue, as database queries are made over HTTP! They provide a database as an API. -- A planetscale community discussion
The data revolution along with serverless app revolution, is ConnectionLess
- aka. Data API
Providers
- PlanetScale
-
The main advantage of our database-js driver is that it can be used in serverless environments that don't allow traditional database connections.
-
- Supabase
- NeonDB
- Deprecated: MongoDB Atlas Data API
- Azure Cosmos
- upstash
Add-ons
- A list of software that turns your database into a REST/GraphQL API
serverless-mysql- It still requires you to call
await mysql.end()
to release connection client-side solution
: unexpected termination of client still leave server-side zombie connection.
- It still requires you to call
- RESTHeart
- a Java backend server that provides REST, GraphQL, and WebSocket APIs
- only support MongoDB as data storage.
Common solution practice
2 tiers connection limit
- When a database reaches the soft-limit we start to terminate the idle connections. We continue to accept new connection requests until the hard-limit is reached. If the database reaches the hard limit then we start rejecting new connections.
- Similar to AWS Lambda approach