Level 9 - DistinguishedOptimization Questionsm5 distributed sql sharding consistency
Optimization: Global Index vs Local Lookup
Choose better architecture answer for order lookup by external_ref under heavy writes. Query A: Create global secondary index on external_ref across all shards and route all lookups through it. Query B: Keep per-tenant/local index and maintain small routing table mapping external_ref prefix -> tenant shard for targeted lookup.