> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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)