Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Geo Location, Spatial Searches, and RavenDB

DZone's Guide to

Geo Location, Spatial Searches, and RavenDB

· Database Zone
Free Resource

Learn how to create flexible schemas in a relational database using SQL for JSON.

I mentioned in the previous post that the data is coming in a highly relational format, and that the MaxMind advice is to not load this into a relational database, because then queries take a long time. Instead, they have their own efficient binary format.

I decided to put this into RavenDB, and that brought the question, how are we actually going to work with this? How do we model the data?

In our code, we defined the following, which I guess would pretty closely match how you model the data in a relational database:

image

Except…

In this case, we are actually storing the whole thing as a single entry, like so:

image

This allows us to query things efficiently and easily. But before we can get there, we need to actually load the data in, which is the topic of my next post.

Create flexible schemas using dynamic columns for semi-structured data. Learn how.

Topics:

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}