> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Choose Your Database

## Article: Choose Your Database

## Article Link: https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/choose-your-database.md

## Article Content:

# Choose Your Database

A Studio Two site can store its data in the built-in Wix CMS or in an [external database](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/external-databases/about-external-databases.md) that you connect to the site. The CMS fits most sites. It's a fully managed database that Wix optimizes for websites.

This article explains why the CMS is the default choice, and when an external database is worth the extra setup.

## Database types

Databases generally fall into these types:

- **Document databases**: Store data as flexible documents. They suit websites.
- **Relational databases**: Store data in tables with defined relationships. They suit complex queries and transactions.
- **Analytical databases**: Store data for reporting and analysis across very large datasets.

The Wix CMS is a document database. Documents map naturally to the JSON objects that web code works with, which makes it easy to store and retrieve the varied content that websites display.

## Advantages of the Wix CMS

The Wix CMS provides several key benefits that make it the preferred choice for most projects:

- **No setup**: A site's collections are ready to use with no configuration.
- **Global performance**: Wix replicates the data globally, so it's fast to access from any location.
- **Built-in security**: PII encryption, GDPR support, and role-based permissions are included.
- **Automatic scaling**: The CMS handles traffic spikes and growth without any work from you.

## When to use an external database

Use the Wix CMS unless one of these applies:

- The data already lives in a database that other systems use, and you don't want to migrate it.
- The data needs a relational database or another specific database engine.
- You need advanced analytics across very large datasets.
- Compliance rules require a particular database technology, or require you to host the data yourself.
- The amount of data is extremely large.

## Wix CMS vs an external database

An external database gives you control over where and how the data is stored, but some Wix Data features work only with CMS collections.

| Feature | Wix CMS | External database |
|---|---|---|
| Setup | None | You host an adapter at a public HTTPS URL |
| Add, update, and remove items | Yes | Only if the table has `_id`, `_createdDate`, `_updatedDate`, and `_owner` fields, and the adapter implements those operations |
| [Query caching](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-api/about-cached-queries.md) | Yes, for qualifying queries | No |
| [Data events](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-api/about-data-events.md) | Yes, for user-created collections | No |
| [CMS Data Sources](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/about-cms-data-sources.md) and dynamic pages | Yes | Yes |
| Premium plan required | No | No |

To connect an external database to a site, see [Connect an External Database](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/external-databases/connect-an-external-database.md).

## See also

- [About Collections](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/about-collections.md)
- [About the Data API](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-api/about-the-data-api.md)
- [About External Databases](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/external-databases/about-external-databases.md)