Feature request: support DynamoDB multi-attribute GSI key schemas
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc secondary_indexes.rb, đường dẫn _si_key_schema và collection định nghĩa thuộc tính được các migration của TableConfig sử dụng. So sánh hành vi hiện tại của hash_key/range_key với tài liệu DynamoDB được liên kết về GSI nhiều thuộc tính, đồng thời lần theo các luồng model và migration hiện có. Được xem là hoàn tất khi một DSL và biểu diễn migration tương thích ngược có thể tạo các schema GSI nhiều thuộc tính mà không chia nhỏ các khai báo giữa các abstraction.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the feature
DynamoDB now supports multi-attribute key schemas for GSIs (up to 4 partition key attributes + 4 sort key attributes).
aws-record currently models GSIs as:
- one
hash_key - optional one
range_key
Because of this, there is no way to define newer GSI key schemas using Aws::Record DSL or TableConfig migrations.
Use Case
In real single-table designs, we currently pack multiple dimensions into synthetic strings (for example STATUS#timestamp#suffix) only because the DSL is limited to one hash + one range key.
With native multi-attribute GSIs, users can:
- avoid manual key concatenation/parsing
- preserve native attribute types
- express more access patterns with cleaner models
- reduce app-side key-munging logic
Proposed Solution
Add first-class support for multi-attribute GSI keys while keeping backward compatibility.
Potential API shape:
global_secondary_index :tournament_region,
hash_keys: %i[tournament_id region],
range_keys: %i[round bracket match_id],
projection: { projection_type: 'ALL' }
Backward-compatible behavior:
hash_key:-> treated ashash_keys: [hash_key]range_key:-> treated asrange_keys: [range_key]
Areas that would need updates:
- index validation (
secondary_indexes.rb) - key schema generation (
_si_key_schema) - attribute definition collection in table config/migration paths
Other Information
Context links:
- AWS announcement: https://aws.amazon.com/about-aws/whats-new/2025/11/amazon-dynamodb-multi-attribute-composite-keys-global-secondary-indexes/
- DynamoDB docs (
GSI.MultiAttributeKeys): https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html#GSI.MultiAttributeKeys - Pattern guide with API examples: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.DesignPattern.MultiAttributeKeys.html
Observed current limit in aws-record main branch:
global_secondary_indexexpectshash_key/range_key_si_key_schemaemits only oneHASH+ optional oneRANGE
Current workaround is using low-level Aws::DynamoDB::Client APIs directly for table/index creation, but then model/table declarations are split between two abstractions.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
aws-sdk-ruby-record version used
2.14.0
Environment details (OS name and version, etc.)
Ruby 3.4.8, aws-sdk-dynamodb 1.161.0
- Ngôn ngữ chính
- Ruby
- Star
- 318
- Fork
- 44
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-record-ruby
-
BuildableSearch#complete!.to_a auto-paginates silently and Limit is per-page (companion to #153)Đang mởfeature-request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
aws/aws-record-ruby#157 · 2 bình luận ·
-
feature-request p2 queued
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
aws/aws-record-ruby#153 · 2 bình luận ·
-
feature-request
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
aws/aws-record-ruby#152 · 3 bình luận ·
-
feature-request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aws/aws-record-ruby#147 · 1 bình luận ·
-
feature-request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
aws/aws-record-ruby#142 · 6 bình luận ·
Tất cả issue của aws/aws-record-ruby
Issue tương tự
-
Kanton Column not HiddenĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
hitobito/hitobito_pfadi_de#164 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 7 ngày
-
Tallied counts an insertion even when the underlying insert raises without changing the dataĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Windows: packaged_agent_ruby? never matches 'Puppet Labs\Puppet', so the openvox gem is not foundĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Falha nos links do postĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100