Reputation: 19408
I need to migrate cities/countries/regions resources from http://www.maxmind.com/app/geoip_resources to my app.
I have two ways: 1. create some tables and save data there 2. create another database and have multiple db connections.
Issues: geoip may be updated, performance. It is supposed to use this resources frequently.
What is best approach to save geoip data?
Thanks for advance!
Upvotes: 1
Views: 92
Reputation: 23678
I would look closely at the reasons for putting stuff outside of your main Database.
If this is the only application that is supposed to use this Data I would go with the easier approach of simply having it inside your regular Rails Application Database (multiple database connections are not something Rails can handle very easily and you may loose niceities like the AR query cache etc).
General rule of thumb: If you don't really need it - save yourself the trouble and put it into the one DB your app is already using. You can still move it outside that DB to a shared Database later if the need arises.
Mind you, replicating the GeoIP DB to all those systems may also be an option as the GeoIP DB is not updated by users but only at certain intervals when a new dataset comes out.
Upvotes: 1