Files
directus/docs/concepts/databases.md
Rijk van Zanten 817ccf3620 Overhaul docs (#3951)
* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

Co-authored-by: Ben Haynes <ben@rngr.org>
2021-02-05 18:51:54 -05:00

2.0 KiB

Databases

The Directus platform is primarily comprised of an API and App, working in concert to “mirror” the schema and content of your SQL database.

Database Mirroring

Instead of using a predefined “one-size-fits-all” data model to store your content, Directus “mirrors” your actual SQL database in real-time. The principle is akin to a database client (like phpMyAdmin), but includes far more advanced tools, and is safe and intuitive enough for non-technical users. This approach has many unique advantages:

  • A custom (pure) SQL database schema, tailored to your exact requirements
  • Significant performance improvements through optimizations and indexing
  • Complete transparency, portability, and security for your data
  • Direct database access and the full power of raw/complex SQL queries
  • Allows importing existing databases, unaltered and without any migrations

Dynamic API

The Directus API uses Database Mirroring to dynamically generate REST endpoints and a GraphQL schema based on the connected database's architecture. It is written in Node.js and uses database abstraction to support most SQL database vendors.

Relevant Docs

Database Abstraction

Directus supports mirroring all the most SQL databases. There are many different SQL database vendors, including popular choices such as MySQL, PostgreSQL, and SQLite. Each vendor has subtle (and sometimes not so subtle) differences in how they function, so Directus includes an abstraction layer that helps it avoid writing different code for each different type.

This means there is the possiblility of supporting other datastores in the future, such as NoSQL options like MongoDB, or even third-party data services like Firebase or Heroku. However these options are fundamentally different from the relational SQL databases we currently support, and so more research is needed.