Build Cloud-Native apps with Apache Cassandra

GOT QUESTIONS from the Workshop? You're in the right place! Post a question here and we'll get you answers.

Click here for Week 7 Materials and Homework.

Registrations still open!


question

anil.kulkarni_169761 avatar image
anil.kulkarni_169761 asked ·

How would you data model for geo-location based apps?

Suppose in the killrvideo app I want to show all the movie theaters near to the user location, how would you model for such cases.

data modeling
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Just finished the workshop and it's 4am for me right now but I just wanted to acknowledge receipt of your question and we'll respond in a few hours. Cheers!

0 Likes 0 · ·

1 Answer

David Jones-Gilardi avatar image
David Jones-Gilardi answered ·

One way you could achieve this is by using a geo-hash. You can implement this using only a Cassandra based data model with no need for other workloads within DataStax Astra.

Check out this video from the personal blog of one of our DataStax folks -> He starts with talking about how to do this with DataStax enterprise, but at around 6:00 talks about how to do this with Astra.

This video comes from his blog. Notice the June 2020 post -> https://github.com/farrell0/DataStax-Developers-Notebook/blob/master/README.md. Notice the Application program code link. Download, untar it, and within you will find some *.cql files with the needed data model to support geo-hashing with a purely Cassandra workload.

BTW, I am making some assumptions at what I think you might want to do with the information you provided

" I want to show all the movie theaters near to the user location"

which is why I am suggesting a geo-hash since you can use it to handle various methods of creating search boxes/polygons to find theatre or whatever locations.

2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks David, I think you answered all of my queries, will give it a try shortly.

1 Like 1 · ·

Great. I would definitely like to know how things turn out for you. Geo problems are pretty fun IMO.

0 Likes 0 · ·