DoorDash’s homepage item carousels needed to filter millions of items by availability in under 300ms. We couldn’t call the menu service at request time (too much fan-out, too slow), so we indexed availability directly in Elasticsearch. We went through three schema iterations: nested documents (600ms), Gojek-style encoded time slots as terms (350ms but 6x storage), and finally range fields backed by BKD trees (250ms, baseline storage). The range approach won on both latency and storage.
