Working with data
By this point you have seen Ring draw a page and drive a clock. The natural next question is the one every application eventually asks: can it carry a normal data load? Here is a working answer — an app holding twenty thousand records inside the Ring VM, in your browser, that you can filter, sort, total and add to.
The app: a savings-circle register
Members of a savings circle put money into numbered rounds — a shape of data any business application will recognise: records with an id, a name, a number, an amount and a status. The page loads them once into the resident VM, and from then on every control calls a Ring function. Filtering as you type, sorting on a header click, validating a form, recomputing totals — all of it runs in Ring, on data that never leaves the VM. Only the answer crosses back.
Measured the way a user feels it
A page is not fast or slow in the abstract — it is fast or slow against how people perceive delay. So every interaction in the app is measured live, against three familiar thresholds:
- instant< 16 ms inside one animation frame — the result is simply there
- responsive< 100 ms feels caused by the click
- noticeable> 100 ms the page is visibly thinking
And because a fast wrong answer is worthless, every result is also recomputed independently in JavaScript and compared, live, with a check mark you can watch. Correctness first, then speed.
The numbers
| Interaction | 20,000 records | 50,000 records |
|---|---|---|
| Draw a page of 25 rows | 0.2 ms | 0.4 ms |
| Recompute the totals | 11 ms | 28 ms |
| Filter, on every keystroke | 15 ms | 38 ms |
| Sort a column | 53 ms | 130 ms |
| Rebuild the leaderboard | 92 ms | 238 ms |
| Load, once at startup | 106 ms | 879 ms |
At twenty thousand records — a generous size for anything a person actually scrolls through — everything the user touches is instant or responsive. At fifty thousand, two interactions become noticeable, and the app labels them as such rather than hiding it.
What building it taught us
Driving this app at full size sharpened the runtime itself and produced a short set of rules for writing fast data pages in Ring — the payload shape that loads fifteen times faster, the loop forms that avoid hidden copies, and more. They are written up where they are most useful:
- Writing a fast data page in Ring — the practical rules, with runnable examples.
- A 50,000-row page and two quadratic surprises — the deep technical story, for the curious.
And what an application built this way looks like
The register above is a data page. Route Orders is the next question answered: a whole business application — a field-sales order pad — with the price tiers, the discounts, the tax, the stock check and the credit limit all running in Ring on the device, and the server used exactly twice. It has a switch marked Cut the connection, and the article carries the two HTTP endpoints in full so the pattern can be built against a back end in any language.