HueForge Palette Optimizer: Sub-Millisecond Lookups
HueForge is software that generates layered 3D models based on the transmission distance (TD) of specific filament colors. Because users often don't have the exact filaments a designer used, I built an API to instantly map a required palette to the closest matching filaments a user actually owns.
The Architecture Flow
[ User Payload (Owned Hex Codes) ] → [ API Gateway ]
↓
[ DynamoDB DAX (Cache) ] ←→ [ AWS Lambda (Distance Calc) ]
↓
[ DynamoDB (Filament Table) ]
1. Single-Table NoSQL Design
I utilized Amazon DynamoDB for its highly predictable performance at scale. I structured the database using a single-table design, combining Brand, Material, Hex Code, and TD values with optimized Partition and Sort keys to allow rapid querying without expensive relational joins.
2. Lambda Compute
The core logic runs in a Python Lambda function. When a user uploads their available filament list, the function calculates the Delta E (color distance) and TD variance to recommend the closest possible layer swaps for their specific HueForge project.
Because the "Global Filament Database" experiences massive read-heavy traffic but very few writes, I implemented DynamoDB Accelerator (DAX). DAX is an in-memory cache that reduces the read response times from milliseconds to microseconds, vastly improving the API's responsiveness while reducing DynamoDB read capacity costs.