AGENT SKILL

flink-architect

Architect-level Flink design — event time and watermarks, stateful operators and state size, checkpointing and exactly-once sinks, savepoints for upgrades, backpressure diagnosis, and the job-graph choices that decide whether a pipeline survives a bad day. Use when stream processing is stateful and correctness-critical.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
flink-architect
license
MIT
metadata
{ "crusor-path": "data-engineering-architect/event-streams-architect/flink-architect", "crusor-domain": "data-engineering-architect", "crusor-origin": "original", "crusor-sources": "nightlies.apache.org/flink/flink-docs-stable/docs/concepts; nightlies.apache.org/flink/flink-docs-stable/docs/ops/state", "crusor-triggers": "flink, event time, watermark, checkpointing, savepoint, stateful stream, windowing, backpressure, flink job", "crusor-verified-on": "2026-10-30" }
description
Architect-level Flink design — event time and watermarks, stateful operators and state size, checkpointing and exactly-once sinks, savepoints for upgrades, backpressure diagnosis, and the job-graph choices that decide whether a pipeline survives a bad day. Use when stream processing is stateful and correctness-critical.
compatibility
Apache Flink, Flink on Kubernetes, Confluent Cloud, AWS Managed Flink

03 SKILL.md 正文

Flink Architect

Flink is state, time, and the recovery boundary. Get state and watermarks right and the rest is tuning; get them wrong and no amount of parallelism helps.

When to use

  • Continuous aggregation, joins, or pattern detection over streams.
  • Exactly-once semantics into a sink matter.
  • Event-time correctness with late data is required.

When NOT to use

  • Stateless filtering/routing — a simpler consumer is enough.
  • Micro-batch latency is acceptable and the team already runs Spark.

Decision 1 — Time semantics

  • Event time (when it happened) for analytics; processing time only for infrastructure-level work.
  • Watermarks declare "we believe we have seen everything up to T". Bounded out-of-orderness, not perfection.
  • Idle partitions stall watermarks — configure idleness detection.
  • Allowed lateness defines how long late events can still update a window; late events beyond it go to a side output, never silently dropped.

Decision 2 — State

  • Keyed state is partitioned by key: choose keys so state is balanced and bounded.
  • State size drives checkpoint size and recovery time — monitor both.
  • Use timers instead of polling; clear state on window close or TTL.
  • Value/List/Map state deliberately; a large Map state becomes a compaction problem.
  • RocksDB for large state, in-memory for small and fast.

Decision 3 — Checkpoints and exactly-once

  • Checkpoint interval balances overhead versus reprocessing on failure (typically 30–120 s).
  • Incremental checkpoints for RocksDB keep them cheap.
  • Exactly-once end-to-end needs a transactional sink (Kafka transactions, Iceberg commits); otherwise you have at-least-once and must deduplicate.
  • Checkpoints to durable object storage, not local disks.
  • Savepoints before every upgrade; they are the only safe migration path for stateful jobs.

Decision 4 — Recovery and upgrades

  • Restore time = checkpoint size ÷ throughput; large state means a long outage window.
  • Plan for state schema evolution: use Avro/Protobuf with schema ids, or write migration code.
  • Savepoint-and-restore drill on a schedule, not only during upgrades.
  • Job upgrades that change the topology may not restore from a savepoint — verify.

Decision 5 — Operations

  • Backpressure: check the UI's backpressure panel and the slowest operator first, not total throughput.
  • Watermark lag is the leading indicator of trouble — alert on it in seconds.
  • Restart strategy: fixed-delay or exponential, but a poison event loops forever — handle deserialisation errors explicitly.
  • Autoscaling streaming jobs is painful; size for peak and use savepoint-based rescaling deliberately.

Failure modes at scale

  • Watermark stall from an idle partition; windows never fire.
  • 400 GB of RocksDB state; recovery takes 40 minutes after every failure.
  • Exactly-once claimed with a non-transactional sink; duplicate rows on retry.
  • Deserialisation error restarts the job forever on the same record.
  • Savepoint taken days before a schema change; restore fails during the upgrade.

Verification receipts

  1. Time semantics and watermark strategy documented.
  2. Checkpoint interval, size, and measured recovery time.
  3. Savepoint/restore drill executed on the real job.
  4. Sink semantics verified with an injected duplicate.
  5. Watermark-lag alert configured and tested.

04 同仓库更多 Skills

SriAkhilSJ
SriAkhilSJ/PulseAIRepo

interaction-patterns-architect

Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-system-ops-architect

Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-handoff-architect

Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

content-microcopy-architect

Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

ui-ux-implementation-architect

Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

test-strategy-architect

Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.

★ 0