1

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.

Community
  • 1
  • 1
vy32
  • 28,461
  • 37
  • 122
  • 246

1 Answers1

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