PostgreSQL, MySQL, MongoDB or Redis: which database should you pick?

How PostgreSQL, MySQL, MariaDB, MongoDB and Redis differ, which one fits your site, and how BrewInTH connects the database to your app for you.
When you create a project on BrewInTH, the Database field offers PostgreSQL, MySQL, MariaDB and MongoDB, plus a checkbox for Redis. This is where many people pause: which one fits my site, can I change it later, and do I even need a database yet?
This article explains the differences in plain words, what each one is good for, how your app gets connected, and the limits worth knowing before you press create.
In short
✅ Not sure? Pick PostgreSQL. It fits almost every kind of project.
✅ Existing PHP or Laravel code written for MySQL? Pick MySQL or MariaDB.
✅ Data stored as JSON documents whose shape changes often? Pick MongoDB.
✅ Redis is an extra for caching, sessions and job queues, not your main store.
✅ One primary database per project, plus one Redis; the connection details reach your app automatically.
Does your site need a database at all?
Not every site does. Ask one question: does the site need to remember something visitors type in?
- No, for example a shop's intro page, a portfolio, or a landing page whose button opens LINE → choose No database for now.
- Yes, for example member accounts, a booking form, a shopping cart, articles edited in an admin page, a survey → you need a database.
If you start without one and need it later, create it on the project's Databases page. No new project required.
The five options in brief

PostgreSQL: the safest default
PostgreSQL is a full-featured relational (SQL) database that handles both tables and JSON. Popular stacks such as Next.js with Prisma, Django, FastAPI, Rails and most Node.js setups work with it out of the box, and it is the first option in BrewInTH's create dialog.
Good for: new sites, booking systems, member systems, small shops, admin tools.
MySQL and MariaDB: when your code already speaks MySQL
MySQL is one of the most widely used SQL databases, especially around PHP. MariaDB started as a fork of MySQL and accepts nearly the same commands. If the code or tutorial you follow was written for MySQL, choosing it keeps things smooth; nobody has to translate SQL.
Good for: existing PHP projects, Laravel apps configured for mysql, sites moving from a host that ran MySQL.
MongoDB: data as documents
MongoDB does not use tables. It stores JSON-like "documents", and two records can have different fields. It suits JavaScript apps built with Mongoose and data whose shape keeps changing.
Good for: Node.js apps already using Mongoose, storing whole payloads from external APIs, logs.
Redis: a speed boost, not a primary store
Redis keeps data in memory, which makes it very fast. Use it as a cache (remember computed results), for sessions (who is logged in) or as a job queue (background work such as sending email). On BrewInTH each project's Redis belongs to that project alone; when its memory fills up, keys that have an expiry (TTL) are removed first.
Important: Redis is not backed up, because it is a cache your app can rebuild. Anything you cannot afford to lose belongs in the primary database.
Still undecided? Use these rules
- You already have code → use whatever it was written for (ask your AI: "Which database does this project use?").
- Starting from scratch → PostgreSQL.
- Your AI plans to use Mongoose or MongoDB → MongoDB.
- The site slows down under traffic or runs background jobs → also tick Redis.
To let your AI help before you create the project, try this prompt:
I'm about to create a project on BrewInTH. It offers PostgreSQL, MySQL,
MariaDB and MongoDB as the database, plus an optional Redis cache.
Look at the code in this folder and tell me which database to choose and why,
and whether I need Redis. Keep it short and don't change any code.
How your app gets connected
Once the database is ready, BrewInTH writes the connection details into the project's App settings (secrets) for you. Your app reads them from environment variables, so no password ever sits in the code.

- PostgreSQL →
DATABASE_URL - MySQL / MariaDB →
MYSQL_URL - MongoDB →
MONGODB_URLandMONGODB_URI - Redis →
REDIS_URL,REDIS_HOST,REDIS_PORT,REDIS_PASSWORD
If your framework expects other names, like Laravel's DB_HOST and DB_DATABASE, the AI that deploys for you adds them to App settings as BrewInTH's guide tells it to.
The database sits on the project's private network: apps running on BrewInTH reach it directly. To look at the data yourself, open the database browser on the project's Databases page (PostgreSQL, MySQL and MariaDB), or let your AI run queries through its connection. MongoDB and Redis are used from the app or from a project command.
Limits to know before you choose
- One primary database per project (PostgreSQL, MySQL, MariaDB or MongoDB), named after the project, plus one Redis.
- Switching the primary engine later means deleting the current database and creating a new one. Data does not move by itself, so choose carefully, or have your AI copy the data across before you delete anything.
- Your number of primary databases equals your project allowance. The free package gives 1 project and 1 database. Need more? Buy the Extra project + database add-on on the packages page. Redis does not count.
- Database space: every package currently allows 512 MB per database. That is plenty for text and numbers, but keep images and videos out of the database.
- Backups are the Backups add-on, for PostgreSQL, MySQL, MariaDB and MongoDB: daily backups, manual backups, and restore from the Databases page. See the price on the pricing section.
Watch the video (in Thai)
▶ From creating a project to opening the site (1:30)
Watch on YouTube
Frequently asked questions
I know nothing about databases. What should I pick?
PostgreSQL, and let your AI handle the rest: creating tables, connecting and running migrations. An AI deploying through BrewInTH reads the connection details on its own.
Can I create a project without a database and add one later?
Yes. Open the Databases page, choose a Database engine and press Create database, or simply ask your AI in the chat to create one.
Can one project use PostgreSQL and MongoDB together?
No. A project has one primary database. If you truly need both, split the work into two projects.
Can Redis replace the main database?
It shouldn't. Redis on BrewInTH is not backed up and drops expiring keys when memory is full. Use it next to a primary database, never instead of one.
Can I connect from a database tool on my computer?
The database lives on the project's private network. Use the database browser in the console, or ask your AI to look at the data. For a full copy of your data, use the Backups add-on and download a backup file.
Summary
Without a special reason, start with PostgreSQL. Existing MySQL code? Use MySQL or MariaDB. Document-style data? MongoDB. Add Redis when you need speed or background jobs. BrewInTH fills in the connection details, and your AI takes care of tables and deployment from there.
Start your first project free →
