React · Architecture · Discussion: is the react-design ecosystem being replaced by another stack?

1.2K
REr/react-design·posted by alice_dev·2 hours agoTooling

Discussion: is the react-design ecosystem being replaced by another stack?

Most react-design articles stop at "how to use it" and never cover "when not to use it". This is an attempt at the second half.

The first thing was to collapse the variables. We were changing config and upgrading the version at the same time, and afterwards nobody could say which change caused what. We rolled back to moving one variable at a time, re-ran three times, and only then did the curve settle. Tedious, but not skippable.

// Minimal reproduction: you must use a real long-tail distribution here.
// Uniform load-test traffic will never trigger this.
func (s *Server) handle(ctx context.Context) error {
    conn, err := s.pool.Acquire(ctx)
    if err != nil {
        return fmt.Errorf("acquire: %w", err)
    }
    defer conn.Release()

    return s.do(ctx, conn)
}

We also fixed monitoring along the way: replaced average-based alerts with percentiles and split them per endpoint. False alerts dropped by about seventy percent and the on-call rotation visibly cheered up.

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.

Worth noting: the official docs do cover this, just in a very inconspicuous spot. I only found it reading the source comments, where the author explains the reasoning — roughly "so that it degrades into predictable behaviour in extreme cases".

185 comments

185 comments

· first 120 loaded
M
Ddev_zhou·just nowedited

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".

513
Ddev_zhou·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

507
Bbob_chen·3 minutes ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

504
Wwinter·28 minutes ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

225
Lli_ming·yesterdayedited

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.

115
Kkernel_panic·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

162
Nnikic·2 days 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.

36
Zzhou_yi·1 hour ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

6
Aalice_devOP·2 days ago

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

140
Llinlin·yesterdayedited

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

496
Wwinter·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

127
Rran_bo·2 days ago

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

124
Sswoole_lee·2 days ago

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

16
Rran_boOP·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

223
Rrase·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

29
Ddev_zhou·2 days ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

292
Llinlin·2 days ago

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

134
Zzhu_zong·2 days ago

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

175
Kkernel_panicMod·2 days agoeditedLevel 6

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

324
Oops_wang·5 hours ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

39
Mmike_xu·2 hours agoLevel 6

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

4
Mmike_xu·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

3
Hhuang_keOP·2 days 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.

79
Sslow_query·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.

72
Zzhou_yi·2 days agoLevel 6

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

35
Cchen_dev·2 days agoLevel 6

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

1
Cchen_devOP·just now

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

414
Nnikic·3 minutes ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

341
Sswoole_lee·28 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.

65
Mmike_xuOP·2 days ago

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

298
Rrase·just now

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

293
Aalice_dev·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

99
Ttang_hao·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

66
Kkernel_panicOP·2 days ago

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

4
Sslow_query·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

58
Cchen_dev·just now

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

276
Ttang_hao·2 days ago

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

192
Sslow_query·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

108
Lli_ming·2 days ago

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".

16
Zzhou_yi·2 days ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

187
Nnikic·2 days 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.

1
LlinlinOP·5 hours ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

43
Aalice_devOP·2 days agoedited

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

4
Ddev_zhou·2 days 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.

109
Rran_bo·28 minutes agoLevel 6

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.

30
Ttang_hao·3 minutes ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

27
Wwinter·2 days 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.

295
Oops_wang·2 days agoeditedLevel 6

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

55
Cchen_dev·2 days agoedited

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

246
Sslow_query·2 days agoLevel 6

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.

132
Kkernel_panic·2 days 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.

2
Hhuang_ke·1 hour ago

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

464
Oops_wang·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

394
Ddev_zhou·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

463
Kkernel_panic·2 hours ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

449
Llinlin·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

363
Mmike_xu·2 days ago

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

318
Zzhu_zong·5 hours ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

360
NnikicMod·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

333
Sswoole_lee·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

328
Zzhou_yi·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

321
Zzhu_zong·12 minutes ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

297
Zzhu_zong·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

362
Ddev_zhou·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

196
Bbob_chen·28 minutes ago

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".

96
Kkite·2 days ago

There is actually a simpler fix that needs no architecture change: move this check up to the gateway and the problem disappears. The cost is one extra lookup at the gateway.

297
Nnikic·12 minutes ago

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

270
Kkernel_panic·1 hour ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

250
Kkernel_panic·3 minutes ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

249
Zzhu_zong·2 days ago

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".

3
Sswoole_lee·2 days agoedited

Saved. I am reworking this area this week — this saves a lot of wrong turns.

243
Zzhou_yi·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

236
Llinlin·2 days ago

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

229
Sslow_queryOP·2 days ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

156
Rran_boOP·2 days 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.

155
Zzhu_zong·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

207
Aalice_dev·2 days 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.

195
Ddev_zhouOP·5 hours ago

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

114
Hhuang_ke·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

33
Wwinter·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

253
Ttang_hao·2 days ago

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

88
Mmike_xu·2 days agoedited

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

66
Nnikic·2 days 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.

170
Ttang_hao·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

169
Kkite·5 hours agoedited

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

144
Wwinter·2 days ago

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

82
Bbob_chen·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

12
Rrase·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

28
Sswoole_leeMod·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

115
Lli_ming·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

108
Hhuang_ke·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

107
Ttang_haoOP·2 days ago

One counter-example: below react-design 7.4 the semantics of that code are different, so do not copy it verbatim. We got burned in staging and rolled back once.

489
Wwinter·2 days ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

105
Aalice_dev·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

97
Kkite·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

79
Lli_mingOP·2 days ago

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

17
Llinlin·2 days ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

47
Hhuang_ke·12 minutes ago

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

28
Lli_ming·12 minutes agoedited

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

348
Hhuang_ke·12 minutes ago

Has anyone run a controlled experiment? I did, reducing it to a single variable, and the difference was 4% — within noise. So I suspect the main cause is something else.

18
Hhuang_keMod·2 days ago

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".

57
Mmike_xu·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

15
Nnikic·3 minutes agoedited

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

9
Bbob_chen·2 days agoedited

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.

64
LlinlinOP·2 days ago

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

61
Hhuang_ke·12 minutes ago

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".

9
Sswoole_lee·2 days 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.

10
Sswoole_lee·2 days ago

A question: what changes in a container with a 512Mi memory limit? That is how we run it in production.

9
Sslow_query·2 days ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

3
Zzhu_zong·2 days ago

This matches what we see in production. We only hit it past 3k QPS; the earlier load tests showed nothing — the test traffic was too clean, with no long-tail requests.

220
Zzhou_yi·2 days ago

This is not a react-design problem, it is a usage problem. The docs say this API is not thread-safe and you must lock around it yourself.

278
Aalice_dev·12 minutes ago

Saved. I am reworking this area this week — this saves a lot of wrong turns.

3
Oops_wang·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

2
Ttang_hao·2 days ago

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

2
Bbob_chen·2 days ago

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".

1
NnikicOP·28 minutes ago

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

274
Nnikic·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

2
Aalice_dev·2 days ago

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".

1
Rran_bo·2 days ago

Agreeing with the above. One addition: with this option enabled the GC count in your metrics doubles, so adjust the alert threshold at the same time or it will keep firing.

1
Llinlin·2 days ago

We have run this in production for two years without hitting it. That said, we never reached this scale, so our experience is not really evidence here.

1

This is the post detail page /en/c/react-design/post/p9. 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 →