dynobase-icon
Dynobase

Question: How do you store location coordinates in DynamoDB?

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Answer

Store latitude and longitude as Number attributes, or put them in a Map representing a location. DynamoDB has no native Point type or geographic-distance Query operator.

For example, an application object can contain location: { latitude: 52.23, longitude: 21.01 }. A GeoJSON Point can also be stored as a map with type: "Point" and a coordinates list, where the order is longitude then latitude. DynamoDB stores the structure but does not automatically interpret or spatially index it. A comma-separated string is possible, but separate numeric values are easier to validate and use.

If you only retrieve a location by an entity ID, the normal primary key is enough. For nearby searches, an application can store a geohash or spatial-cell identifier in indexed attributes, query candidate cells and calculate exact distances afterward. Cover adjacent cells and handle boundaries; a single geohash-prefix lookup does not guarantee every nearby point is included.

For complex polygons, distance ranking or extensive geographic filtering, use a dedicated geospatial search system alongside DynamoDB. A GSI on latitude alone does not provide a two-dimensional proximity index.

See GSI design and data types for the storage and indexing primitives.

Source: AWS supported types.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.