Discord bots ยท databases

Discord bot hosting with a database that lasts

Economy, levels, tickets, reminders: the moment a bot remembers something, it needs a database that survives a restart. Here it is one click away on a private network, reachable by name, the first one free.

Engines
MySQL, PostgreSQL, MongoDB, Redis
First database
Free on every account
Reach
By name over the private network
Files
The bot's own disk persists too

Why free databases elsewhere bite

On generalist platforms the free database is the trap: one large host's free PostgreSQL expires thirty days after creation, and its free key-value store is in memory only, with restarts causing data loss and no upgrade path that keeps the data. A bot that loses its economy table on a restart is worse than a bot without one.

How it works here

  1. On the bot's page, add a database: MySQL, PostgreSQL, MongoDB or Redis.
  2. The connection string is injected into the bot's environment; the bot connects by name over the private network, never over the public internet.
  3. Backups are taken with the bot; the database survives redeploys, restarts and version changes.

If you prefer a file, SQLite on the bot's disk persists between restarts too; a managed database is for bots that run in several places or grow past a few hundred megabytes.

Which engine

NeedEngine
Economy, levels, tickets, anything relationalMySQL or PostgreSQL
Cooldowns, caches, queues, session stateRedis
A small bot with one tableSQLite on disk

Frequently asked questions

Is the database free?

The first database on an account is free; more are $2, $4 or $8 a month by size.

Can I connect from my PC?

Databases are private by default and reachable from your own apps and servers. Join the private network from your machine or turn on public access for a database when you need to.

Does the database survive a redeploy?

Yes. Redeploys replace the bot's code, not its data; the database and the bot's disk stay.

Can a game server and a bot share one database?

Yes: everything on the account sees the same private network, so a status bot and a Minecraft plugin can read the same MySQL.

Related

Discord bot hosting with a database that lasts

Host a bot with a database