S
S
Sergey Pashkevich2018-09-04 16:53:49
MySQL
Sergey Pashkevich, 2018-09-04 16:53:49

Search by cities with local database (MySQL) of countries and cities in different languages?

Good afternoon!
The site needed to link products to cities (in order to then display products depending on the country or city).
Three options were considered for implementation:

  1. Storage of all countries, regions and cities in supported languages ​​in its database
  2. Partial storage with dynamic replenishment (storage in the database + writing new data)
  3. Linking to third-party services (geonames) and storing its identifier in its database

Option 1 - ( similar question ) is the most reliable and correct option , but requires control and support. Minus: increase the size of the database (which can affect the speed with backups).
Option 2 - you need to add additional logic to the application code.
Option 3 - additional logic is also needed for converting identifiers into names, etc. If the service stops working, then the application will stop working correctly.
1) If you implement the first option and store all countries and cities (~ 2 million records) in different languages, won't queries pedal when searching using likeby several columns (different languages), since the user can enter a city, a country in a different language?
2) What database structure is better to implement (there is such an option )? Will it work for states, counties, etc.?
I would be very grateful for any advice! Thank you )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ambrosian, 2018-09-04
@Ambrosian


Option 1 - (similar question) is the most reliable and correct option, but requires control and support.

You still have to because
On the site, there was a need to link products to cities (in order to then display products depending on the country or city ).

A
Alex-1917, 2018-09-05
@alex-1917

sypexgeo.net/ru/features
but in general the problem is sucked from the finger.
There are 2.7 million cities in the world, with city status assigned by local authorities. For example, in Denmark there are a lot of cities in which 250 people live
. then a landmark for a city with 1 million people. There are not even three hundred of them.
There are 83,000 cities in the service mentioned above !!! sypexgeo.net/ru/stats

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question