O C A T I O N S 3 0 M I N U T E D R I V E 6 0 M I N U T E D R I V E 2,500+ Store Locations ~19k Employees 14 Distribution Hubs 7,000+ Delivery Vehicles ~500 Onsite Locations
Detection Repair Custom Packaging Custom Chain Sling Bandsaw Blades Tool Repair Tool & Cutter Regrind Stud Cutting Special Assemblies Lifting & Rigging V A L U E - A D D W I T H I N T H E S U P P L Y C H A I N
Product, Customer Warehouse (v1.0.0) Initial Discussions With First Developer March First Development Cluster Online April Official Product Search Project Charter Fastenal Becomes Elasticsearch Inc. Support Customer (v.1.1) Built Ugly POC
Category Description Ø Metadata related to servicing search requests Ø No child docs Root Fasteners Bolts Eye Bolts U-Bolts Screws Wood Screws Lag Screws Safety Protective Garments Sleeves Hand Protection Glove Bags Level One Level Two Level Three
the catalog index is used to calculate which products belong to which catalogs based on the business rules Ø Initial Structure Ø 1 parent type doc Ø 1 child doc Ø 1 grand child Ø Challenges with grandchild docs Ø Inefficient Ø Cause: Slow search response time Ø Effect: Slow indexing rate of product index Ø Complex query structure Ø Cause: Nested "has_child" query Ø Effect: Increased dev and test time Ø Current Structure Ø 1 parent type doc Ø 1 child doc
generic application framework to farm out work to other machines or processes that are better suited to do the work.” Ø It has three main parts: Ø Client Ø Job server Ø Worker Ref: http://gearman.org/
1 Worker type 2 Worker type 3 (PHP Code) Index builder Worker type 1 queue Worker type 2 queue Worker type 3 queue Search product category catalog … Logging
Server 2 Server 3 (PHP Code) Query databases Stream data Index builder Enhance data from Elasticsearch Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue
Server 2 Server 3 Query databases Stream data Enhance data from Elasticsearch Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue (PHP Code) Index builder
Server 2 Server 3 Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue (PHP Code) Index builder Query databases Stream data Enhance data from Elasticsearch
Server 2 Server 3 Index search data into Elasticsearch Index log data into Elasticsearch Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue (PHP Code) Index builder Query databases Stream data Enhance data from Elasticsearch
Server 2 Server 3 Index search data into Elasticsearch Enhance data from Elasticsearch Index log data into Elasticsearch Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue (PHP Code) Index builder Query databases Stream data Enhance data from Elasticsearch
Server 2 Server 3 Index search data into Elasticsearch Enhance data from Elasticsearch Index log data into Elasticsearch Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue (PHP Code) Index builder Query databases Stream data Enhance data from Elasticsearch
Server 2 Server 3 Index search data into Elasticsearch Enhance data from Elasticsearch Index log data into Elasticsearch Worker type 1 Worker type 2 Worker type 3 Worker type 1 queue Worker type 2 queue Worker type 3 queue (PHP Code) Index builder Query databases Stream data Enhance data from Elasticsearch
scrolling helper index 10+ updates Sleep Time Initial create SKUs Initial create SKUs Single update by scrolling helper index helper index Time Time V1: 24+ hours V2: 18+ hours Current: < 12 hours
to save disk space Ø Elastic Data modeling Future Ø Avoid updates for full index build Ø Really large docs Ø Get rid of parent-child/nested docs Ø Over-tokenize fields