What's the most efficient way to store IP addresses in Amazon's DynamoDB? Another article describes the Most efficient way to store IP Address in MySQL , but it uses a function that's not available in DynamoDB.
Asked
Active
Viewed 1,022 times
1 Answers
1
The most compact fixed-width representation would be to convert the IPv6 address to its 128-bit (16 byte) representation. DynamoDB supports Binary scalars as an attribute value and Key type, so you could just store this 128 bits in a Binary attribute. This representation may include non-printing and special characters, so you may also consider the fixed (20 byte) width representation using printing characters in IETF RFC 1924.

Community
- 1
- 1

Alexander Patrikalakis
- 5,054
- 1
- 30
- 48