r/java • • Feb 12 '23

Geo-Assist is a 2-dimensional implementation of K-D Tree, that allows you to load and find nearest neighbors for the provided geo-location in an efficient manner. I used this implementation for applications with ~35m requests per day. Hence a generic open-source project, open for suggestions

https://github.com/thegeekyasian/geo-assist

[removed] — view removed post

69 Upvotes

15 comments sorted by

3

u/papercrane Feb 12 '23

Looks like a neat project. It would be useful to add a bounding box query method.

I'd be interested to see how it compares to the k-d tree implementation in JTS.

3

u/elemur Feb 12 '23

Right I was going to say a shape polygon type of match with metadata constraints would be amazing. Still looks nice though!

1

u/[deleted] Feb 23 '23

[removed] — view removed comment

2

u/elemur Feb 24 '23

Looking forward to polygon and eventually line and poly line operations as well. Nice!

1

u/glusus Feb 13 '23

Curious how it works with ec2 hosts. Haven't read the code, but do you do replicas for fault tolerance?

2

u/glusus Feb 13 '23

Maybe this is a single host data store limited by in memory limits, would love to see it work with storage and sharding

2

u/stefanos-ak Feb 13 '23

look at the code, it's very small. it's just an in-memory tree. I guess if all your data fit in memory then it is definitely the best way to query them.

But personally I doubt I would ever make such an engineering decision. If I knew I needed to scale in any way, I would delegate this to a database... like MongoDB for example.

1

u/glusus Feb 15 '23

Makes sense, i was curious to see if this can work at scale and looking at the code, this is currently 1 host

2

u/[deleted] Feb 13 '23

[removed] — view removed comment

2

u/[deleted] Feb 23 '23

[removed] — view removed comment

1

u/glusus Feb 24 '23

Thanks for sharing! Taking a look