Database

From OpenStreetMap Wiki
(Redirected from Database/Model)
Jump to: navigation, search
Available languages — Database
· Afrikaans · Alemannisch · aragonés · asturianu · azərbaycanca · Bahasa Indonesia · Bahasa Melayu · Bân-lâm-gú · Basa Jawa · Baso Minangkabau · bosanski · brezhoneg · català · čeština · dansk · Deutsch · eesti · English · español · Esperanto · estremeñu · euskara · français · Frysk · Gaeilge · Gàidhlig · galego · Hausa · hrvatski · Igbo · interlingua · Interlingue · isiXhosa · isiZulu · íslenska · italiano · Kiswahili · Kreyòl ayisyen · kréyòl gwadloupéyen · Kurdî · latviešu · Lëtzebuergesch · lietuvių · magyar · Malagasy · Malti · Nederlands · Nedersaksies · norsk bokmål · norsk nynorsk · occitan · Oromoo · oʻzbekcha/ўзбекча · Plattdüütsch · polski · português · português do Brasil · română · shqip · slovenčina · slovenščina · Soomaaliga · suomi · svenska · Tiếng Việt · Türkçe · Vahcuengh · vèneto · Wolof · Yorùbá · Zazaki · српски / srpski · беларуская · български · қазақша · македонски · монгол · русский · тоҷикӣ · українська · Ελληνικά · Հայերեն · ქართული · नेपाली · मराठी · हिन्दी · অসমীয়া · বাংলা · ਪੰਜਾਬੀ · ગુજરાતી · ଓଡ଼ିଆ · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · සිංහල · ไทย · မြန်မာဘာသာ · ລາວ · ភាសាខ្មែរ · ⵜⴰⵎⴰⵣⵉⵖⵜ · አማርኛ · 한국어 · 日本語 · 中文(简体)‎ · 吴语 · 粵語 · 中文(繁體)‎ · ייִדיש · עברית · اردو · العربية · پښتو · سنڌي · فارسی · ދިވެހިބަސް
Railsport DB scheme

The main database is a key component of OpenStreetMap, because obviously it's where we keep all our data.

Please note that this is not the only database used to generate maps. Have a look at Component overview to see what other databases exist.

The main database is accessed for editing via the API. If you want to get data see APIs for multiple available options.

Data model

The database contains tables for each Element type (nodes, ways, relations). In fact for each of these there are several database tables: current, history, current_tags, history_tags. In addition there are database tables for storing changeset, gpx_files, users, diary entries, sessions, oauth etc.

You can get a detailed look at the SQL statements at Rails port/Database schema.

Databases elsewhere will be structured differently. For example most applications only need the current map data. Different OSM tools use different database setups (See Databases#Database_Schemas).

Postgres server instance

OpenStreetMap switched from MySQL to a PostgreSQL server for its main site on April 19 2009 [1] that is part of the rails port. This is running on a separate machine Servers/smaug. On April 1 2012 a process of moving to a new server commenced. For problems see Platform Status.

Querying

QuadTiles indexes for all nodes are used for faster querying (using B-tree index in Postgres).

Database statistics

As with all Servers we have munin stats for smaug.openstreetmap.org (realtime graphs showing server resource usage). See also Statistics.

See also