[OSM-dev] Main database wiki page
gravitystorm at gmail.com
Mon Dec 12 14:17:17 UTC 2016
On 12 December 2016 at 11:54, Darafei "Komяpa" Praliaskouski
<me at komzpa.net> wrote:
> I've been googling for current human-readable document that describes what
> OSM database currently is.
As far as I'm aware, there's no up-to-date human-readable description
of the primary OSM database. The database contains 40+ tables, and a
bunch of foreign keys, sequences, and of course, many columns, so
maintaining any documentation is not a trivial task. That's likely why
any documentation you find is unlikely to have been kept up to date
over the years.
> Can someone with deeper knowledge update this page, and/or make it point to
> a better place to read about current OSMF database cluster setup?
There are two aspects to the database - A) the internal structure
(tables, columns etc) and B) the production cluster setup
(replication, backups etc)
A) The internal structure is governed by the openstreetmap-website
code base, specifically the db/structure.sql definition.
This is not very human-friendly, but it is accurate. I never use this
myself, since I find it easier to read the definitions in app/models/
to find how the different tables relate to each other, and I use the
postgresql command line to find out the details of the structure, if
B) The cluster configuration is managed via the Chef configuration, found at:
What happens on each machine is defined in the roles, and the set-up
of database-related machines is controlled by the "db" cookbook.
Again, these are not particularly human-readable, but since they are
the real code that controls the configuration, they are always
accurate. Again, I don't usually read the role files directly, but I
would use https://hardware.openstreetmap.org/ , which is generated
from the Chef configuration automatically, as a starting point and a
more human-friendly approach.
Please let me know if you have any questions and I'll do what I can to help.
More information about the dev