0
votes

I need to store coordinates in Azure and had intended on using table storage. My idea was to be able to query for a subset of coordinates based on two coordinates e.g:

enter image description here

So my query (I think) would be, give me all the points where

  • The latitude is less than 53.360238 and greater than 53.344204
  • The Longitude is greater than -6.276734 and less than -6.250122

I had originally thought about saving them as:

ParititonKey, RowKey

"16.775833,-3.009444", "Timbuktu"
...

But realised I would end up with thousands of partitions. I assumed that this would be really bad for doing a query as I would have to touch many partitions possibly on different networks.

Also I'm not sure how it would work given a partition / row query is a string comparison..

I was wondering if there was a better way to store the points, for example I was thinking something like:

ParititonKey, RowKey, Title

16.775833,-3.009444, "Timbuktu"
...

This makes the query easier but doesn't solve the unique partition problem e.g

Get all entites where partition key is less than X and greater than Y AND where RowKey is greater than A and smaller than B

Is there a more efficient way to do this, perhaps by saving the whole number of the latitude as the partition key and the remainder in the RowKey?

ParititonKey, RowKey, Title

16,    775833^-3.009444, "Timbuktu"
...

Any advice is appreciated!

1
This is a fairly broad question: Choosing a particular database type (e.g. key/value, document, time-series, relational, etc.) or specific database brand (e.g. DocumentDB) is not something that has a simple answer. And we don't really know much about your app other than that you're storing geospatial data. You'd likely need to look at your other requirements, do some benchmarking, etc. Now: If this is strictly about how to build queries against Table Storage for this type of data, ok - you should edit your question to remove the discussion about other database types.David Makogon
Well if I remove the part about DocumentDB, then the question still stands about which of the listed ways is preferable to store the data in Azure table storage?TomSelleck

1 Answers

0
votes

My suggestion would be to use DocumentDb to store this kind of unstructured data and you can easily write SQL like queries on more than one field.

Table storage is built more for key value pairs only