Changeset View
Changeset View
Standalone View
Standalone View
src/docs/flavor/so_many_databases.diviner
@title Why does Phabricator need so many databases? | @title Why does Phorge need so many databases? | ||||
@group lore | @group lore | ||||
Phabricator uses about 60 databases (and we may have added more by the time you | Phorge uses about 60 databases (and we may have added more by the time you | ||||
read this document). This sometimes comes as a surprise, since you might assume | read this document). This sometimes comes as a surprise, since you might assume | ||||
it would only use one database. | it would only use one database. | ||||
The approach we use is designed to work at scale for huge installs with many | The approach we use is designed to work at scale for huge installs with many | ||||
thousands of users. We care a lot about working well for large installs, and | thousands of users. We care a lot about working well for large installs, and | ||||
about scaling up gracefully to meet the needs of growing organizations. We want | about scaling up gracefully to meet the needs of growing organizations. We want | ||||
small startups to be able to install Phabricator and have it grow with them as | small startups to be able to install Phorge and have it grow with them as | ||||
they expand to many thousands of employees. | they expand to many thousands of employees. | ||||
A cost of this approach is that it makes Phabricator more difficult to install | A cost of this approach is that it makes Phorge more difficult to install | ||||
on shared hosts which require a lot of work to create or authorize access to | on shared hosts which require a lot of work to create or authorize access to | ||||
each database. However, Phabricator does a lot of advanced or complex things | each database. However, Phorge does a lot of advanced or complex things | ||||
which are difficult to configure or manage on shared hosts, and we don't | which are difficult to configure or manage on shared hosts, and we don't | ||||
recommend installing it on a shared host. The install documentation explicitly | recommend installing it on a shared host. The install documentation explicitly | ||||
discourages installing on shared hosts. | discourages installing on shared hosts. | ||||
Broadly, in cases where we must choose between operating well at scale for | Broadly, in cases where we must choose between operating well at scale for | ||||
growing organizations and installing easily on shared hosts, we prioritize | growing organizations and installing easily on shared hosts, we prioritize | ||||
operating at scale. | operating at scale. | ||||
Listing Databases | Listing Databases | ||||
================= | ================= | ||||
You can get a full list of the databases Phabricator needs with `bin/storage | You can get a full list of the databases Phorge needs with `bin/storage | ||||
databases`. It will look something like this: | databases`. It will look something like this: | ||||
``` | ``` | ||||
$ /core/lib/phabricator/bin/storage databases | $ /core/lib/phorge/bin/storage databases | ||||
secure_audit | secure_audit | ||||
secure_calendar | secure_calendar | ||||
secure_chatlog | secure_chatlog | ||||
secure_conduit | secure_conduit | ||||
secure_countdown | secure_countdown | ||||
secure_daemon | secure_daemon | ||||
secure_differential | secure_differential | ||||
secure_draft | secure_draft | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
We have a large number of tables (more than 400) and we can not reasonably | We have a large number of tables (more than 400) and we can not reasonably | ||||
reduce the number of tables very much (each table generally represents some | reduce the number of tables very much (each table generally represents some | ||||
meaningful type of object in some application). It's easier to develop with | meaningful type of object in some application). It's easier to develop with | ||||
tables which are organized into separate application databases, just like it's | tables which are organized into separate application databases, just like it's | ||||
easier to work with a large project if you organize source files into | easier to work with a large project if you organize source files into | ||||
directories. | directories. | ||||
If you aren't developing Phabricator and never look at the data in the | If you aren't developing Phorge and never look at the data in the | ||||
database, you probably won't benefit from this organization. However, if you | database, you probably won't benefit from this organization. However, if you | ||||
are a developer or want to extend Phabricator or look under the hood, it's | are a developer or want to extend Phorge or look under the hood, it's | ||||
easier to find what you're looking for and work with the tables when they're | easier to find what you're looking for and work with the tables when they're | ||||
organized by application. | organized by application. | ||||
More Databases Cost Nothing | More Databases Cost Nothing | ||||
=========================== | =========================== | ||||
In almost all cases, creating more databases has zero cost, just like | In almost all cases, creating more databases has zero cost, just like | ||||
Show All 10 Lines | |||||
can destroy all the databases with `bin/storage destroy`. | can destroy all the databases with `bin/storage destroy`. | ||||
As mentioned above, an exception to this is that if you're installing on a | As mentioned above, an exception to this is that if you're installing on a | ||||
shared host and need to jump through hoops to individually authorize access to | shared host and need to jump through hoops to individually authorize access to | ||||
each database, databases do cost something. | each database, databases do cost something. | ||||
However, this cost is an artificial cost imposed by the selected environment, | However, this cost is an artificial cost imposed by the selected environment, | ||||
and this is only the first of many issues you'll run into trying to install and | and this is only the first of many issues you'll run into trying to install and | ||||
run Phabricator on a shared host. These issues are why we strongly discourage | run Phorge on a shared host. These issues are why we strongly discourage | ||||
using shared hosts, and recommend against them in the install guide. | using shared hosts, and recommend against them in the install guide. | ||||
Next Steps | Next Steps | ||||
========== | ========== | ||||
Continue by: | Continue by: | ||||
- learning more about databases in @{article:Database Schema}. | - learning more about databases in @{article:Database Schema}. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0