Learn about databases
Databases hold your application's state. Compare the types and see how to host them, connect to them and protect your data.
Featured
- CostsHow much does database hosting cost?Cloud database hosting costs from zero to hundreds of dollars a month. See what sets the price: instance, disk, traffic, snapshots, and how to estimate yours.
- How-to guidesHow to host a database for your appTo host a database, pick an engine, create the instance, store the connection string in an environment variable and test the connection. Step-by-step guide.
- ConceptsWhat is Redis used for?Redis is an in-memory data store that keeps key-value pairs and rich data structures. Learn how it works, what it is used for and when not to use it.
Concepts5
- What is Redis used for?Redis is an in-memory data store that keeps key-value pairs and rich data structures. Learn how it works, what it is used for and when not to use it.
- What is PostgreSQL?PostgreSQL is an open source relational database that uses SQL and guarantees ACID transactions. Learn how it works, what it is for and when to pick another one.
- What is MongoDB and when to use itMongoDB is a NoSQL document database that stores data in JSON-like documents. Learn how it works, what it is good for, and when another database fits better.
- MongoDB collections, clusters and replica sets explainedA collection groups documents, a replica set is a group of servers holding copies of the same data, and a cluster is the whole set serving your database.
- What is MySQL?MySQL is an open source relational database that stores data in tables and queries it with SQL. See how it works, what it is used for and when to skip it.
How-to guides4
- How to host a database for your appTo host a database, pick an engine, create the instance, store the connection string in an environment variable and test the connection. Step-by-step guide.
- How to back up your databaseBack up MySQL, PostgreSQL and MongoDB with mysqldump, pg_dump and mongodump, then restore the dump. See the commands, how to verify and common mistakes.
- How to connect MongoDB to Node.js (and to your hosting)To connect MongoDB to Node.js, install the official mongodb driver, create a MongoClient with your connection string and reuse that client. See the steps.
- Database migrations on deployRun database migrations on deploy with Prisma, Drizzle or Alembic: one step before the new code starts, safe against failures. Commands, checks and mistakes.
Problems and errors3
- MongoServerSelectionError: why MongoDB won't connectMongoServerSelectionError means the driver found no usable MongoDB server in time. Learn the causes, how to diagnose each one and how to fix the connection.
- ECONNREFUSED: database connection refusedECONNREFUSED means nothing is listening on the database host and port. See the causes (server down, localhost, wrong port, bind address) and how to fix each one.
- 'Too many connections': database connection pooling explained'Too many connections' means your database hit max_connections. Learn why it happens in MySQL and PostgreSQL, how to diagnose it, and how pooling fixes it.
Costs3
- How much does database hosting cost?Cloud database hosting costs from zero to hundreds of dollars a month. See what sets the price: instance, disk, traffic, snapshots, and how to estimate yours.
- How much does PostgreSQL hosting cost?PostgreSQL hosting costs from zero to hundreds of dollars a month. See what sets the price (RAM, disk, replicas, traffic), billing models and how to estimate yours.
- How much does Redis hosting cost?Redis hosting costs from zero to tens of dollars a month for small projects. The price comes from RAM, commands, persistence and replicas. Learn how to estimate it.
Comparisons6
- PostgreSQL vs MySQLPostgreSQL is the safer default for new projects, and MySQL suits simple apps well. Compare SQL features, JSON, indexes, transactions and ecosystem.
- MongoDB vs PostgreSQL: which should you choose?MongoDB vs PostgreSQL compared: data model, joins, transactions, JSON, indexes and scaling, plus when each database is the better fit for your project.
- Redis as a cache vs as a databaseRedis as a cache holds disposable copies in RAM; as a database it needs persistence (RDB or AOF). See the differences, the config and when to use each mode.
- SQL vs NoSQL: which database to chooseSQL stores data in tables with relations and a fixed schema. NoSQL covers document, key-value and other models. See the differences and when to use each.
- MariaDB vs MySQL: differencesMariaDB vs MySQL? MariaDB is a fork of MySQL, and today the two diverge on JSON, versions, replication and features. See the table and when to use each.
- SQLite vs a database server: when to switchSQLite vs a database server like PostgreSQL or MySQL: how each handles writes, networks and size, with a side-by-side table and clear signs it is time to switch.
Which to choose3
- How to choose a database for your projectFor most projects, PostgreSQL or MySQL is enough. See when to pick MongoDB, Redis or SQLite instead, with clear criteria and a recommendation per scenario.
- Best database for Node.jsFor most Node.js projects, PostgreSQL is the safest choice. See when to use MySQL, MongoDB, Redis or SQLite instead, with drivers and code examples.
- Best database for PythonPostgreSQL is the safest choice for most Python projects, and SQLite is enough for scripts and small apps. See when MySQL, MongoDB or Redis make more sense.