Clean Architecture · Chinese · The edge cases the clean-architecture-zh docs never spell out

11
CAr/clean-architecture-zh·posted by chen_dev·32 minutes agoTranslation

The edge cases the clean-architecture-zh docs never spell out

Short version: clean-architecture-zh needs almost no tuning at small and medium scale — the point where it starts to hurt is much further out than most people assume. Full measurements below.

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.

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.

Ggithub.comExternal link · opens in a new tab
3 comments

3 comments

M
Rrase·just now

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.

344
Ttang_haoOP·3 minutes agoedited

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

206
Mmike_xu·28 minutes 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.

153

This is the post detail page /en/c/clean-architecture-zh/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 →