LyEve Core
Database on Neon
Neon offers a free serverless PostgreSQL database. The engine treats it as a plain Postgres server, so the only thing to set up is the connection string.
Before you start
Link to the section Before you start- A Neon account with a project and a database.
- A role for the engine other than
postgres. A production engine refuses to start aspostgres.
Get the connection string
Link to the section Get the connection stringOpen your project's connection details in the Neon console. Neon offers a pooled string, whose
host contains -pooler, and a direct one. Use the direct string:
postgres://<role>:<password>@<endpoint>.<region>.aws.neon.tech/<dbname>?sslmode=requireThe pooled endpoint runs in transaction mode, which hands each transaction to whichever server connection is free. The engine keeps its own pool of long-lived connections, and while it applies migrations at startup it holds a session lock that a transaction-mode pooler does not keep.
Secrets
Link to the section SecretsSet the string as DATABASE_URL on the engine, through your host's secret store. Neon requires
TLS, so keep ?sslmode=require.
Connection limits
Link to the section Connection limitsKeep DATABASE_MAX_CONNECTIONS small, such as 5, so the engine stays under the plan's
connection limit even while a redeploy runs the old and new engine side by side. The default is
25.
Health checks
Link to the section Health checksThe engine's /readyz answers 503 while the database cannot be reached, and /healthz does
too. A host that restarts the container on a failed liveness check may restart it while Neon
resumes. Give the check a grace period of at least the time Neon takes to resume. A restart
also signs everyone out once their access token expires, 15 minutes by default, because refresh
tokens live in the engine's memory unless CACHE_DRIVER=redis and REDIS_URL point at a Redis.
Start the engine and ask for readiness on either port:
curl https://<engine-url>/readyzA 200 with "status":"ok" means the engine connected and applied its migrations. If the
first request after idle time is slow, check whether the container, Neon's compute, or both were
resuming.
- Database on Supabase: another free managed Postgres.
- Free-tier stack: the $0 recipe with an engine host.
- Run the engine and LyEve Console together: the console in front of the engine, on one address.
- Supported databases: why SQLite, Turso and libSQL are not an option.