<div dir="ltr">Thanks a lot. <div>I've updated the wiki page based on information from your e-mail.<br><a href="https://wiki.openstreetmap.org/wiki/Database">https://wiki.openstreetmap.org/wiki/Database</a> <br></div></div><br><div class="gmail_quote"><div dir="ltr">пн, 12 дек. 2016 г. в 17:17, Andy Allan <<a href="mailto:gravitystorm@gmail.com">gravitystorm@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12 December 2016 at 11:54, Darafei "Komяpa" Praliaskouski<br class="gmail_msg">
<<a href="mailto:me@komzpa.net" class="gmail_msg" target="_blank">me@komzpa.net</a>> wrote:<br class="gmail_msg">
<br class="gmail_msg">
> I've been googling for current human-readable document that describes what<br class="gmail_msg">
> OSM database currently is.<br class="gmail_msg">
<br class="gmail_msg">
As far as I'm aware, there's no up-to-date human-readable description<br class="gmail_msg">
of the primary OSM database. The database contains 40+ tables, and a<br class="gmail_msg">
bunch of foreign keys, sequences, and of course, many columns, so<br class="gmail_msg">
maintaining any documentation is not a trivial task. That's likely why<br class="gmail_msg">
any documentation you find is unlikely to have been kept up to date<br class="gmail_msg">
over the years.<br class="gmail_msg">
<br class="gmail_msg">
> Can someone with deeper knowledge update this page, and/or make it point to<br class="gmail_msg">
> a better place to read about current OSMF database cluster setup?<br class="gmail_msg">
<br class="gmail_msg">
There are two aspects to the database - A) the internal structure<br class="gmail_msg">
(tables, columns etc) and B) the production cluster setup<br class="gmail_msg">
(replication, backups etc)<br class="gmail_msg">
<br class="gmail_msg">
A) The internal structure is governed by the openstreetmap-website<br class="gmail_msg">
code base, specifically the db/structure.sql definition.<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://github.com/openstreetmap/openstreetmap-website/blob/master/db/structure.sql" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/openstreetmap/openstreetmap-website/blob/master/db/structure.sql</a><br class="gmail_msg">
<br class="gmail_msg">
This is not very human-friendly, but it is accurate. I never use this<br class="gmail_msg">
myself, since I find it easier to read the definitions in app/models/<br class="gmail_msg">
to find how the different tables relate to each other, and I use the<br class="gmail_msg">
postgresql command line to find out the details of the structure, if<br class="gmail_msg">
necessary.<br class="gmail_msg">
<br class="gmail_msg">
B) The cluster configuration is managed via the Chef configuration, found at:<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://github.com/openstreetmap/chef" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/openstreetmap/chef</a><br class="gmail_msg">
<br class="gmail_msg">
What happens on each machine is defined in the roles, and the set-up<br class="gmail_msg">
of database-related machines is controlled by the "db" cookbook.<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://github.com/openstreetmap/chef/tree/master/roles" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/openstreetmap/chef/tree/master/roles</a><br class="gmail_msg">
<a href="https://github.com/openstreetmap/chef/tree/master/cookbooks/db" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/openstreetmap/chef/tree/master/cookbooks/db</a><br class="gmail_msg">
<br class="gmail_msg">
Again, these are not particularly human-readable, but since they are<br class="gmail_msg">
the real code that controls the configuration, they are always<br class="gmail_msg">
accurate. Again, I don't usually read the role files directly, but I<br class="gmail_msg">
would use <a href="https://hardware.openstreetmap.org/" rel="noreferrer" class="gmail_msg" target="_blank">https://hardware.openstreetmap.org/</a> , which is generated<br class="gmail_msg">
from the Chef configuration automatically, as a starting point and a<br class="gmail_msg">
more human-friendly approach.<br class="gmail_msg">
<br class="gmail_msg">
Please let me know if you have any questions and I'll do what I can to help.<br class="gmail_msg">
<br class="gmail_msg">
Thanks,<br class="gmail_msg">
Andy<br class="gmail_msg">
</blockquote></div>