dr5hn / countries-states-cities-database

🌍 Discover our global repository of countries, states, and cities! 🏙️ Get comprehensive data in JSON, SQL, PSQL, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities
https://dr5hn.github.io/countries-states-cities-database/
Open Data Commons Open Database License v1.0
7.55k stars 2.6k forks source link

Safe to refer to items using their auto increment id (while inheriting future datasets) #873

Closed Vimiso closed 1 month ago

Vimiso commented 1 month ago

Is it safe to refer to cities etc by their auto increment id? Or do future versions of the database get issued with new/missed cities slotted into some position resulting in a shift of all auto increments? Otherwise, are all new items always added to the end of any given dataset? Thanks.

dosubot[bot] commented 1 month ago

Hey @Vimiso! I'm a bot here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

The countries-states-cities-database does not provide specific guidelines or best practices for using auto increment IDs as references, nor does it specify how new cities are added to the database in terms of affecting existing auto increment IDs. Therefore, it's unclear if new items are always added to the end of the dataset or if they might cause shifts in auto increment IDs [1][2][3].

If maintaining stable references is crucial for your application, it might be safer to use alternative unique identifiers, if available, or implement a strategy to handle potential changes in auto increment IDs across different versions.

To continue talking to Dosu, mention @dosu.

mtsfer commented 1 month ago

@Vimiso New items are always added at the end of the dataset, so the chances of id colision are low.