Question: How do you store location coordinates in DynamoDB?

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.
Other Common DynamoDB FAQ (with Answers)
- How do you parallelize requests in DynamoDB?
- What are the naming conventions in DynamoDB?
- Can QuickSight read DynamoDB?
- Can you rename a DynamoDB table?
- Will I be charged for an inactive DynamoDB table?
- What is an access pattern in DynamoDB?
- What are the differences between DynamoDB and MySQL?
- Is DynamoDB a relational database?
- Does DynamoDB support atomic updates?
- How do you create an index in DynamoDB?
- Are DynamoDB table names globally unique?
- Can you store objects as DynamoDB items?
- Is DynamoDB ACID compliant?
- Is DynamoDB open source?
- Why is DynamoDB better than MongoDB?
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable