← Back
Home › Systems › Payments and commerce

promotions-engine

coupons and promotions engine

Shopify discounts

SystemTechniques · 8Primitives · 34 promotions-engine Mixed-integer programming (branch a…optimization · medium: Solves LPs with integer variables by solving the LP relaxation, branching on a fractional variable, and pruning subtrees whose LP bound cannot beat the incumbent.›A/B testing (online controlled expe…statistics · medium: Randomly split units into arms by a salted hash, log exposure, compare metrics with a confidence interval, and guard the result with sample-ratio, guardrail and peeking checks.›Rete rules enginesystems · medium: Match many rules against changing facts by caching partial matches in a shared network, so each change only does the work it actually affects.›Cutting planesoptimization · medium: Valid inequalities added to an LP relaxation to cut off its fractional optimum without removing any integer point; the engine of branch-and-cut MIP solvers.›Presolve reductionsoptimization · medium: Cheap, provably safe reductions run before the solver (fix variables, drop rows, tighten bounds and coefficients) so LP and MIP solves start from a smaller, tighter model.›Hypothesis testingstatistics · medium: Pick a test statistic, compare it to its distribution under "no effect", read off a p-value, and control error rates across one test or many.›Sequential hypothesis testingstatistics · medium: Group-sequential and alpha-spending designs for interim analyses without inflating errorRCU (read-copy-update)concurrency · low: Readers access shared data with no locks or atomic writes; writers publish a new copy and free the old one after a grace period.›Sharded countersconcurrency · low: Split one hot counter into per-core or per-thread cells on separate cache lines; increments stay local and reads sum the cells.›Bloom filterdata-structures · low: Bit array answering "definitely not present" or "probably present" in about 10 bits per key for 1 % false positives; inserts are cheap, deletes impossible.›Interval treedata-structures · low: Index of ranges that answers "which intervals overlap this point or range?" in O(log n + k); static sorted-array form is the compact, cache-friendly choice.›Idempotency keysfinance · low: Client-chosen unique key per logical operation, stored with a request fingerprint and the final response, so retries replay the first result instead of acting twice.›Largest remainder roundingfinance · low: Splitting an amount into parts that sum exactly (largest remainder / Hamilton) for allocations, splits and prorationsMoney representationfinance · low: Store money as integer minor units with an explicit currency exponent, compute in wider integers, and round once with a named rounding mode.›Csprngsecurity · low: OS-backed cryptographically secure random numbers (getrandom), and when a fast PRNG is not enoughOptimistic concurrency controlstorage · low: Run transactions without locks, record what they read, and validate at commit that nothing changed; fastest when conflicts are rare.›d-ary heapdata-structures · low: Array heap with d children per node (d = 4 typical): half the binary heap's depth, siblings in one cache line, faster priority queues.›Simplex methodoptimization · low: Solves linear programs by walking along the edges of the feasible polytope from vertex to vertex, one basis swap (pivot) at a time; the workhorse behind MIP solvers.›Bootstrap confidence intervalsstatistics · low: Resampling-based confidence intervals for arbitrary statisticsCUPED (variance reduction with pre-…statistics · low: Subtract the part of each unit's outcome that a pre-experiment covariate predicts; the effect estimate stays unbiased and its variance shrinks by 1 - rho^2.›Experiment layering (overlapping ex…statistics · low: Partition the tunable parameters into layers, hash each unit with a per-layer salt so layers are independent, and give experiments inside a layer disjoint bucket ranges.›Deterministic bucketingsystems · low: Hash a stable unit id with a per-purpose salt into a bucket; "in" means bucket below the percentage, so assignment is stateless, repeatable and only grows on ramp-up.›Swiss tabledata-structures · low: Open-addressing hash table that filters 8-16 slots at once with 1-byte hash tags and SIMD, giving fast lookups at 87.5 % load.›+ 1 more techniques+ 18 more primitives

Similar systems

Share the most building blocks with this one.