How to handle entry and storage of location info with Phoenix and Ecto?

Many apps have addresses, but I’m not sure how many of those try to validate those given the nature of actual valid addresses being super complex and a list of cities likely being outdated a month after an update.

I made @kip deal with that question for his tzworld library recently. You can have a look here: Tz_world / timezone_boundary_builder update - #5 by LostKobrakai

It’s a tradeoff for access time against space in memory (against space on disk, which you likely have enough of). He used an in memory cache in places to prefilter the list of possible matches completely in memory. Not sure if there’s something like that you could do / or need.

Another option would be using postgres and proper full text search or even elasticsearch. Fuzzy text search requires a lot of details and sometimes one is better of using an existing solution for a problem.

2 Likes