A shop owner opens an order export, selects paid orders, and asks for revenue by region. The calculation is straightforward. The engineering problem appears when the export becomes large: while JavaScript scans it, typing, clicking Cancel, and updating the results panel can all wait behind that calculation. Local Orders Lab is our small, reproducible version of this application. It uses synthetic orders, integer cents, and calculations performed in the browser.
We will evolve the same application through four lessons. First we isolate computation. Then we design ownership and a bounded pool. Next we introduce shared memory and atomic operations. Finally we protect a multi-field invariant with a mutex and examine what happens when workers fail. The companion WebAssembly Mastery seriesadds an existing compiled database library to the same orders problem.
| Part | New capability | Question we must answer |
|---|---|---|
| 1. Foundations | Calculate away from the UI | Which thread owns each action? |
| 2. Pools | Process independent batches | Who owns each buffer and pending job? |
| 3. Shared memory | Read one dataset from several workers | What makes a shared update safe? |
| 4. Production | Protect invariants and recover | What happens when an owner disappears? |
You need functions, arrays, modules, and promises. If tasks and microtasks are unfamiliar, work through Async JavaScript first. All learner code in this series is JavaScript. The embedded editor contains the complete runnable example; the smaller panels isolate the boundary currently being explained.