Словарь system design: scale out, consistency, throughput, partition
Тема дорожной карты · Английский для IT
🔊 Словарь терминов с произношением →
Интервью по system design — часовой разговор о проектировании системы (Design a URL shortener, Design Twitter's feed, Design a rate limiter), и его успех наполовину зависит от владения словарём, потому что рассуждать вслух о компромиссах без точных слов невозможно. Структура ответа: clarify requirements — уточнить требования: functional (что делает) и non-functional (сколько, как быстро, как надёжно); estimate scale — оценить масштаб: DAU (daily active users), QPS / RPS (запросов в секунду), read-to-write ratio, storage per year, bandwidth, back-of-the-envelope calculation — прикидка на салфетке; high-level design — крупными блоками; deep dive — углубиться в один компонент; trade-offs и bottlenecks; wrap up. Масштабирование: scale up / vertical scaling — мощнее машина; scale out / horizontal scaling — больше машин; stateless сервисы за load balancer; round-robin, least connections, consistent hashing; sharding / partitioning — разделение данных: by user id, by range, by hash; hot partition / hot key / hot spot — перегруженный шард; replication: leader-follower (ранее master-slave), multi-leader, leaderless; read replica; replication lag. Согласованность: consistency — strong, eventual, causal, read-your-writes; CAP theorem — при partition (разрыве сети) выбор между consistency и availability; PACELC; ACID против BASE; idempotency; at-least-once / at-most-once / exactly-once; distributed transaction, two-phase commit, saga; consensus (Raft, Paxos), quorum, leader election, split brain. Хранение: SQL vs NoSQL, key-value store, document store, wide-column, graph database, time-series, object storage, blob, CDN, cache (cache-aside, write-through, write-back, TTL, eviction policy: LRU, LFU), cache hit ratio, cache stampede, bloom filter, inverted index, LSM tree / B-tree, write-ahead log. Асинхронность: message queue, pub/sub, event streaming, producer / consumer, consumer group, dead letter queue, backpressure, fan-out, fan-in. Надёжность: single point of failure, redundancy, failover, health check, heartbeat, circuit breaker, retry with exponential backoff and jitter, rate limiting (token bucket, leaky bucket, sliding window), graceful degradation, load shedding — сброс нагрузки. Метрики: latency (p50, p99, tail latency), throughput, availability (nines), durability, SLA / SLO. Прочее: API gateway, service discovery, reverse proxy, WebSocket vs long polling, CDC (change data capture), denormalization, materialized view, precompute, batch vs stream processing, lambda architecture, cold path / hot path, fan-out on write vs fan-out on read (классика для ленты Twitter).
Как произносится
Scale out /ˌskeɪl ˈaʊt/, consistency /kənˈsɪstənsi/, throughput /ˈθruːpʊt/, partition /pɑːrˈtɪʃən/ (ударение на второй слог), shard /ʃɑːrd/, sharding /ˈʃɑːrdɪŋ/, replica /ˈrɛplɪkə/, replication /ˌrɛplɪˈkeɪʃən/, eventual /ɪˈvɛntʃuəl/, availability /əˌveɪləˈbɪləti/, CAP /kæp/ как слово, ACID /ˈæsɪd/, BASE /beɪs/, quorum /ˈkwɔːrəm/, consensus /kənˈsɛnsəs/, Paxos /ˈpæksɒs/, Raft /rɑːft/, idempotency /ˌaɪdɛmˈpoʊtənsi/, saga /ˈsɑːɡə/, cache /kæʃ/, eviction /ɪˈvɪkʃən/, LRU по буквам, bloom filter /bluːm ˈfɪltər/, queue /kjuː/, fan-out /ˈfæn aʊt/, backpressure /ˈbækprɛʃər/, jitter /ˈdʒɪtər/, token bucket /ˈtoʊkən ˈbʌkɪt/, leaky bucket /ˈliːki ˈbʌkɪt/, load shedding /loʊd ˈʃɛdɪŋ/, DAU по буквам, QPS по буквам, back-of-the-envelope /ˌbæk əv ði ˈɛnvəloʊp/, denormalization /diːˌnɔːrməlaɪˈzeɪʃən/, heuristic /hjʊˈrɪstɪk/.
Как употребляется
Фрагмент рассуждения:
Let me start with requirements. Functionally: shorten a URL, redirect, optional custom alias, expiry. Non-functionally: low latency on redirect, high availability, and links must not be lost. Scale: say 100 million new URLs a month, that's roughly 40 writes per second, and with a 100-to-1 read-to-write ratio, about 4,000 redirects per second, peaking maybe 10x. Storage: 500 bytes per record, 100 million a month, so about 600 GB a year; that fits a single Postgres for years, but I'd shard by the hash of the short code to scale out later. Redirects are read-heavy, so I'd put a cache in front, cache-aside with a 24-hour TTL; the hot keys will be a tiny fraction. For the short code I'd use base62 of a counter or a random 7-character string with a uniqueness check; the trade-off is predictability versus collision handling. Availability matters more than strong consistency here: a redirect that's a few seconds stale is fine, so eventual consistency across replicas is acceptable. The single point of failure is the ID generator, so I'd use a range-based allocator per node. Let me deep-dive into the cache eviction policy if that's useful.
Ловушки
Первая ловушка — начинать рисовать без требований: первые пять минут всегда clarify requirements. Вторая — scale up и scale out как синонимы. Третья — partition с ударением на первый слог и как «раздел диска»: в распределённых системах это разделение данных или сети. Четвёртая — consistency только как ACID: в CAP это другое, более узкое значение. Пятая — цифры без единиц: 4k чего — QPS, записей, гигабайт? Шестая — master-slave: в 2026 году говорят leader-follower или primary-replica. Седьмая — eventually как «возможно»: это «в конечном счёте». Восьмая — не называть компромиссы: фраза the trade-off is должна прозвучать несколько раз за интервью, иначе решение выглядит непродуманным. Девятая — NoSQL как «лучше SQL»: ответ всегда it depends on the access pattern.