I am working on a search query which needs to do a geospatial filter (i.e. filter all elements outside of a certain radius). We have both PostgreSQL and ElasticSearch as part of our infrastructure and I am evaluating which of the two to use.
I'm not asking for "which is better", but an objective pros & cons list would be helpful, in terms of ease of implementation, performance, scalability, etc.
The postgis scales the same way as postgresql scales. The postgis index will work pretty the same as other relational, you may check it out here.
If you take a look at the link, it explains that it indexes using some geometrical algorithm which is performed on each insert operation, so it might not be responsive enough in real-time apps.
While elasticsearch have real time indexing, based on Lucene index. Elastic search generally suits better for realtime heavy applications, then Postgresql.
Postgresql has a huge advantage it is simplicity. It is much easier to implement test and maintain such a feature using Postgresql. For example, I prefer creating prototype based on Postgresql quickly, and if it starts perform bad because of big amount of writes, etc. I switch to elasticsearch implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With