"Database" covers many different designs, each built for a different job. A relational database keeps an online shop's orders consistent, a key-value store makes a login session load instantly, and a columnar database adds up a year of sales in seconds. This guide explains the main types in plain terms, what each is good at, and how to choose one for your project.
Most websites and business applications should start with a relational database: MySQL or MariaDB for PHP sites such as WordPress, or PostgreSQL for new applications. Add a key-value store such as Redis for caching and sessions, a document database when your data has no fixed shape, a graph database when relationships are the data, and a columnar or OLAP database for heavy reporting. "NoSQL" is an umbrella for the non-relational types, not a type of its own.
1. The main types at a glance
| Type | Stores data as | Best at | Well-known examples |
|---|---|---|---|
| Relational (SQL) | Tables of rows and columns, linked by keys | Transactions, consistency, flexible queries | MySQL, MariaDB, PostgreSQL, SQL Server, SQLite |
| Document | JSON-like documents | Data whose shape varies from record to record | MongoDB, CouchDB, Firestore |
| Key-value | A value looked up by a unique key | Very fast reads and writes: caches, sessions, counters | Redis, Valkey, Memcached, DynamoDB |
| Wide-column | Rows with flexible column families, spread over many servers | Huge write volumes across clusters | Apache Cassandra, ScyllaDB |
| Graph | Nodes and the relationships between them | Following connections: social networks, recommendations, fraud | Neo4j, Amazon Neptune |
| Columnar (OLAP) | Each column stored together, compressed | Aggregating millions of rows for reports | ClickHouse, DuckDB, BigQuery, Snowflake |
Two newer categories are also common in 2026: time-series databases for readings over time (sensor data, metrics) and vector search for AI features such as semantic search. Both are often added to an existing database, for example the TimescaleDB and pgvector extensions for PostgreSQL, rather than run separately.
2. Relational databases
A relational database stores data in tables. Each row is a record and each column an attribute, and every table has a schema that fixes the column names and types.
- A primary key identifies each row uniquely, for example
customer_id. - A foreign key in another table points back to it, for example
orders.customer_id, and the database refuses an order for a customer who does not exist. This is referential integrity. - Relationships can be one-to-one, one-to-many (one customer, many orders) or many-to-many (students and courses), which uses a junction table between the two.
SELECT c.name, COUNT(o.id) AS orders
FROM customers c
JOIN orders o ON o.customer_id = c.id
GROUP BY c.name;Relational databases guarantee ACID transactions: a transfer either completes fully or not at all (atomicity), leaves the data valid (consistency), is not disturbed by other transactions running at the same time (isolation), and survives a crash once committed (durability). That is why banking, billing, stock control and most business software use them.
Modern relational databases also store JSON. PostgreSQL's jsonb type and MySQL's JSON type let you keep flexible fields next to structured ones, which removes many reasons to add a separate document database.
3. Document databases
A document database stores each record as a self-contained document, usually JSON or a binary form of it (MongoDB uses BSON). Documents in the same collection can have different fields, and related data is often nested inside the document instead of spread across tables.
{
"_id": "ord_1042",
"customer": { "name": "Asha", "city": "Pune" },
"items": [ { "sku": "TS-01", "qty": 2 } ],
"status": "shipped"
}This suits product catalogues with varied attributes, content management and data that arrives in changing shapes. The trade-off: data duplicated across documents must be kept in step by your code, and queries that join many collections are harder than in SQL. Current MongoDB versions support multi-document transactions, but they are used more sparingly than in relational systems.
4. Key-value stores
A key-value store is the simplest design: you store a value under a key and fetch it by that key, often from memory in well under a millisecond.
SET session:8f2a "user_id=517" EX 3600
GET session:8f2aTypical jobs are caching expensive query results, login sessions, rate limiting and queues. Redis is the best known; Valkey is an open-source fork of Redis that most Linux distributions now package. Key-value stores are not designed for searching by anything other than the key, so they sit next to a main database rather than replacing it.
5. Wide-column and columnar databases
These two are often confused, and the old name "column-oriented" covers both.
- Wide-column stores such as Cassandra organise data by row key into flexible column families and spread it across many servers. They are built for enormous write volumes and always-on clusters, for example storing events from millions of devices.
- Columnar analytical databases such as ClickHouse and DuckDB store each column together on disk. A query that sums one column over 100 million rows reads only that column, and similar values compress extremely well. They are made for reporting and dashboards, not for updating individual records.
6. Graph databases
A graph database stores nodes (people, products, accounts) and edges (follows, bought, blocked), and both can carry properties and labels. Following a chain of connections, such as "friends of friends who bought this", is a quick walk through the graph instead of a series of expensive joins.
MATCH (a:User {name: 'Asha'})-[:FOLLOWS]->(:User)-[:FOLLOWS]->(suggestion:User)
RETURN DISTINCT suggestion.name;That query is written in Cypher, Neo4j's language; GQL is the newer ISO standard graph query language based on similar ideas. Graphs suit social features, recommendations, fraud detection and network maps. For ordinary business records, a relational database is simpler.
7. OLAP, data warehouses and object databases
OLAP (online analytical processing) means analysing data from many angles. Data is modelled as facts (a sale, with an amount) and dimensions (date, product, region), and you "slice and dice" it: sales by month, then by region, then by product. Classic OLAP "cubes" have largely been replaced by columnar data warehouses that run these queries directly in SQL. Keep them separate from your live application database, so heavy reports do not slow the website.
Object-oriented databases store programming-language objects directly. They remain niche. What most developers actually use is an ORM (object-relational mapper), such as Eloquent in Laravel, Django's ORM, Prisma or Hibernate, which maps objects in your code to rows in a relational database. An ORM is a library, not a type of database.
8. How to choose
- Start relational.For a website, shop, CRM or SaaS app, MySQL/MariaDB or PostgreSQL covers almost everything, including some JSON data.
- Add a cache when speed demands it.Put Redis or Valkey in front of slow queries and use it for sessions.
- Add a specialist database for a specialist job.Graph for deep relationships, columnar for analytics, a document store for truly unstructured data, wide-column for massive distributed writes.
- Weigh the running cost.Every extra database is another thing to back up, secure, update and monitor.
For a head-to-head comparison of the four engines most web projects choose between, read choosing between PostgreSQL, MySQL, SQLite and MongoDB.
9. Which databases you can use on Domain India
| Product | Database available | Notes |
|---|---|---|
| cPanel, DirectAdmin, Webuzo shared hosting | MariaDB/MySQL with phpMyAdmin | Port 3306 is closed from outside; connect remotely through an SSH tunnel |
| Windows (Plesk) hosting | Microsoft SQL Server | Managed in Plesk |
| App Platform | Managed PostgreSQL, one per app | Your app receives the connection string as DATABASE_URL |
| VPS | Anything you install | Full root access; you manage updates, security and backups |
Other engines, such as MongoDB, Redis, Neo4j or ClickHouse, are not listed in the shared hosting plans, so ask support before you rely on one there. MongoDB Atlas cannot be reached from our shared servers, because its standard port is not open in the outbound firewall. For those, use a VPS, or the App Platform with PostgreSQL. The details, including database counts per plan, are in what database do you offer.
- 25 GB NVMe SSD Storage
- 50 GB Monthly Bandwidth
- 1 Website
- 10 Email Accounts
- 512 MB RAM per app
- 1 vCPU
- 5 GB NVMe SSD
- PostgreSQL Database
Plan cards show live Domain India list prices, excluding 18% GST.
What are the main types of databases?
The main types are relational (SQL) databases, document databases, key-value stores, wide-column stores, graph databases and columnar analytical (OLAP) databases. Time-series and vector databases are newer specialist types, often added as extensions to an existing database.
What is the difference between SQL and NoSQL databases?
SQL databases are relational: data lives in tables with a fixed schema and is queried with SQL, with strong transaction guarantees. NoSQL is an umbrella term for the non-relational types, such as document, key-value, wide-column and graph databases, which trade some of that structure for flexibility or scale.
Is MongoDB a document database or a NoSQL database?
Both. NoSQL is the broad category, and a document database is one kind of NoSQL database. MongoDB stores data as JSON-like documents, so it is a document database and therefore also a NoSQL database.
Which database should I use for a website?
For most websites, a relational database. WordPress and most PHP applications use MySQL or MariaDB; many new applications use PostgreSQL. Add a cache such as Redis only when you need the extra speed.
What does ACID mean?
ACID stands for atomicity, consistency, isolation and durability. It means a transaction either happens completely or not at all, leaves the data valid, is not disturbed by other transactions, and is kept safely once committed.
Is an ORM a type of database?
No. An ORM (object-relational mapper), such as Eloquent, Django's ORM or Prisma, is a code library that maps your program's objects to rows in a relational database.
Can I use MongoDB on Domain India shared hosting?
No. Shared hosting provides MariaDB/MySQL, and MongoDB Atlas cannot be reached from our shared servers. Use a VPS, where you can install MongoDB yourself, or the App Platform with its managed PostgreSQL database.
Ready to build? Start with MySQL on cPanel hosting, PostgreSQL on the App Platform, or any database you like on a VPS. If you are unsure which your application needs, ask our team.
Tell us what you are building and the database it was written for, and we will point you to the right plan.
Ask our team