Shyam Kotak
Shyam Kotak

Reputation: 23

Amazon AWS DynamoDB Help Picking Primary Key

I'm developing an iPhone app and I am hoping to retrieve events from a DynamoDB (Amazon Web Services) using their latitude and longitude (get events close to the user). Their is other information that each event has, and would also be retrieved when querying the database.

My question, however, is that DynamoDB is asking for my primary key for the table. However, I want to sort by using two values, and when searching, I'll be searching using a range of values. Do you have any ideas on what I should make my primary key? Could I just use an event ID, and still be able to query the database by latitude and longitude? Or is DynamoDB not the right database for me?

Your help is very much appreciated.

Upvotes: 1

Views: 322

Answers (1)

mkobit
mkobit

Reputation: 47259

In terms of Dynamo DB support for geospatial data, AWS released a Java library for that. It is based around the concept of a geohash. There is a big blog post about the "Geo Library" split into 4 parts:

  1. Table Structure
  2. GeoDataManagerConfiguration
  3. Creating Amazon DynamoDB Tables
  4. Put Geo Point

Upvotes: 2

Related Questions