Advanced data modeling: Using user-defined types and Protocol Buffers for Amazon Keyspaces
Database Blog
This article demonstrates how to model complex data in Amazon Keyspaces using user-defined types (UDTs) and Protocol Buffers, comparing their strengths and use cases for a real estate property management system.
- User-defined types (UDTs) provide native CQL integration with server-side schema validation and field-level querying capabilities
- UDTs support up to eight nesting levels, 256 per region, and 50 per table with a 25 KB schema size limit
- Protocol Buffers offer schema evolution, compact binary serialization, and cross-language compatibility stored as BLOB fields
- UDTs require the frozen keyword for nested UDTs and collections but don't support ALTER TYPE after creation
- Protobuf provides forward/backward compatibility and decoupled application schemas but lacks server-side validation and requires full-object reads for updates
- Choose UDTs for stable schemas with field-level queries; choose Protobuf for evolving schemas and multi-store portability
Amazon Keyspaces supports both approaches for modeling complex data, enabling developers to select the best solution based on schema stability, query patterns, and evolution requirements.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
2024
2025
2026
2026
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.