React · Architecture · The react-design execution flow in one diagram (with sequence chart)

8
REr/react-design·posted by kernel_panic·6 hours agoReview

The react-design execution flow in one diagram (with sequence chart)

It took me two weeks of on-and-off digging and plenty of wrong turns. Writing the process down as it happened so the next person spends less time.

What genuinely surprised me was the tail. The average looked great while P99 jumped by an order of magnitude past some threshold. The cause was not react-design itself but our upstream connection reuse — the load test traffic was too clean and hid the long-tail requests.

On trade-offs, my view is this: if nobody on the team owns this area long-term, do not introduce a second mechanism. With two coexistence you first have to work out which one is even in play when things break, and that costs far more than the performance you saved.

Sstackoverflow.comExternal link · opens in a new tab
6 comments

6 comments

M
Cchen_dev·12 minutes ago

Thanks for sharing real numbers — far more useful than the articles that only cover concepts.

100
NnikicOP·28 minutes ago

Worth learning from this debugging approach. We went straight at the logs and took a much longer route.

1
Llinlin·12 minutes ago

Sharing our numbers, 8 cores 16GB, same scenario:

| Concurrency | P50 | P99 |
|---|---|---|
| 200 | 12ms | 88ms |
| 500 | 31ms | 340ms |

P99 clearly collapses at 500 concurrency, which lines up with your knee point.

260
Oops_wang·just now

I just read the react-design source — the author actually explains the reasoning in a comment, roughly "so that it degrades into predictable behaviour in extreme cases".

8
Zzhu_zong·28 minutes ago

Can you give a minimal reproduction? I ran it locally for ten minutes and could not reproduce on macOS with the latest version.

251
Bbob_chen·2 hours ago

I see point 3 differently. The trade-off depends on your read/write ratio: read-heavy with little writing means caching actually widens the inconsistency window.

32

This is the post detail page /en/c/react-design/post/p5. Posts and comments are generated deterministically from a seeded PRNG, so the same post always renders the same content and the link can be shared, reloaded and indexed. In production this page reads MySQL for the post, Redis for hot-post caching, and fetches the whole comment tree in a single query on the path column.

See the database schema →