Analyze with AI
Get AI-powered insights from this Mad Devs article:
Your order service already publishes to Kafka, and several consumers run in AWS. Kinesis ingestion costs look attractive, but moving the stream changes how those consumers resume, replay, and protect their outputs.
Consider a hypothetical order-change stream. A reporting consumer needs the latest order state. A settlement consumer needs every relevant transition to calculate money owed. Both read identical events; they should not automatically share a migration decision.
The useful Kinesis vs Kafka comparison starts with these contracts. Before approving a pilot, establish whether each consumer can recover its required business state within an agreed deadline.
Key takeaways
- Evaluate consumer groups separately, even when they share a topic.
- Test replay against retained records and actual destination writes.
- Move a consumer only when recovery evidence satisfies its owner; keep unresolved consumers on Kafka.
Compare the guarantees your stream uses
Start with the deployed system, rather than a generic feature chart. Record whether Kafka is self-managed, Confluent Cloud, or Amazon MSK, plus broker and client versions, producer settings, topic cleanup policies, and consumer isolation. For Kinesis, record capacity mode, retention, producer library, and the exact Kinesis Client Library (KCL) version. This guide evaluates direct shard consumption with KCL; changing the consumption mechanism needs a separate review.
Apache Kafka's design documentation describes partition ordering and offset-based consumption. A key provides useful business ordering only while routing and producer behavior preserve the intended sequence. Neither platform supplies a global business order across independently processed partitions or shards.
| Contract question | Kafka evidence | Kinesis evidence |
|---|---|---|
| Which events must stay ordered? | Partition assignment, producer retries, and processing concurrency | Partition-key routing, producer behavior, and shard processing |
| Where does processing resume? | Committed offset for each topic partition | KCL checkpoint for each shard, including subsequence position when applicable |
| How far back can it replay? | Actual time/size retention and cleanup policy | Configured retention and oldest available record |
| What makes repeated work safe? | Destination transaction or idempotency mechanism | Destination transaction or idempotency mechanism |
A Kafka offset and a Kinesis sequence number identify positions in different logs. They are not interchangeable migration cursors. Keep stable application event IDs across both transports and establish a cutover boundary using those IDs. AWS documents partition keys, sequence numbers, and KCL metadata.
Retention is also distinct from checkpointing. A saved position cannot restore records that have expired. Kafka compaction preserves keyed state under its documented conditions; it does not preserve every historical transition. Verify that the settlement topic actually retains the history its owner expects.
Finally, separate delivery from business effects. Kafka transactions can coordinate Kafka input offsets and Kafka outputs under the appropriate configuration. They do not automatically make an external payment or database write happen once. AWS likewise documents duplicate processing after producer retries and consumer restarts. In both systems, recovery must be tested through the destination.
Write down each consumer contract
For this article's hypothetical evaluation, give every event an immutable event_id, an order_id, an increasing order version, an event timestamp, and a schema version. Preserve the event ID when retrying or bridging. A transport sequence number cannot deduplicate the same business event published twice with different transport positions.
The following values are illustrative acceptance requirements, not platform performance claims. Have the named owners replace them with production requirements before testing.
| Requirement | Reporting consumer | Settlement consumer |
|---|---|---|
| Acceptable lag | Five minutes during normal operation | One minute during normal operation |
| Replay requirement | Rebuild from an authoritative current-state snapshot plus subsequent events | Reprocess seven days of retained order transitions |
| Duplicate protection | Conditional upsert by order ID and version | Unique event ID recorded atomically with the ledger entry |
| Required side effect | Correct latest order state in the reporting store | One ledger entry per eligible event; correct net amount |
| Recovery criterion | After a two-hour pause, converge within 30 minutes | After the same pause, reconcile every eligible event within 30 minutes |
| Accountable owner | Reporting lead | Payments lead |
Specify the snapshot's consistency boundary. It must identify which events are already represented and where incremental reading begins; otherwise, a “fresh snapshot” can conceal a gap. Version checks must prevent older replayed updates from overwriting newer state. Include deletions in the contract as well.
For settlement, define what counts as an eligible transition, how reversals work, and how long deduplication entries remain valid. Their lifetime must cover the supported replay window. A successful handler return is insufficient if the ledger write failed or an external payment request timed out.
An owner must approve both the requirement and its evidence. If nobody can identify the authoritative snapshot or reconciliation source, classify that consumer as requiring additional investigation before a migration pilot.
Test a consumer pause and replay
Run the test in an isolated environment with representative event sizes, key distribution, concurrency, and downstream limits. Use synthetic orders and a deterministic expected ledger. Keep production payment endpoints disconnected. This is a proposed test procedure, not a claim that Mad Devs has run this migration.
Establish the baseline. Feed identical event IDs to the current Kafka path and candidate Kinesis path. Include multiple updates for one order, unrelated orders, a cancellation, and a deliberately repeated event. Save the input manifest, configuration, checkpoint positions, and destination state. Both paths must first produce the expected normal-operation output.
Pause consumption, not production. Stop both candidate consumers for two hours while continuing the representative input rate. Record event age, backlog, write failures, and downstream capacity. Preserve their checkpoint stores. Restart the same logical applications from those checkpoints, rather than creating new application identities that begin elsewhere.
Measure recovery through the destination. Track age from event creation to durable output, alongside catch-up duration and errors. Broker lag or shard iterator age alone does not establish that a database or ledger is current. Compare reporting rows with the authoritative snapshot and subsequent event manifest. Require the latest expected version for each order, including cancellations, within the contract's deadline.
For settlement, reconcile eligible event IDs, entry counts, reversals, and total amounts with the expected ledger. Equal totals alone can conceal one missing credit and one missing debit. Require no unexplained missing entries and no extra business effects.
Inject the dangerous failure window. Terminate a worker after its destination write succeeds but before its checkpoint advances. Restart it and confirm that the repeated event produces no additional ledger entry. Then fail a destination write and confirm that the checkpoint does not move past unfinished work. Handle processing exceptions explicitly: AWS warns that an unhandled KCL record-processor exception can cause records to be skipped. AWS's duplicate-record guidance explains why restarting from a checkpoint can repeat processing.
Verify the replay boundary. Start a separate replay reader at the agreed historical boundary without overwriting the live consumer’s checkpoints, and compare recovered IDs with the manifest. Separately exercise reporting's snapshot bootstrap. If the required records are outside retention, record a failed contract unless an independently tested archive recovery path supplies them. Do not silently reset to the newest available event.
Record the outcome per consumer: configuration, observed lag, recovery time, missing IDs, duplicate effects, and owner approval. For example, reporting can pass convergence while settlement fails because its duplicate check and ledger insert are separate writes. That illustrative outcome supports moving reporting and retaining settlement pending a transaction fix; it does not condemn either transport.
Convert test results into a migration decision
Choose the smallest migration boundary supported by the evidence. Passing reporting's contract does not validate settlement's history or ledger guarantees. Conversely, a settlement defect should not automatically block an independent reporting path with a proven recovery mechanism.
| Decision | Evidence required | Next action |
|---|---|---|
| Move reporting to Kinesis | Correct snapshot boundary, version-safe updates, and pause/replay tests passing | Pilot one reporting group with a reversible cutover |
| Keep settlement on Kafka or evaluate MSK | Existing recovery contract passes; candidate replay or ledger behavior remains unresolved | Preserve the working path and address the failed requirement |
| Investigate before choosing | Missing recovery source, untested retention, or unexplained reconciliation differences | Assign an owner and rerun the specific failed test |
Amazon MSK belongs in the shortlist when the objective is reducing broker administration while retaining Kafka interfaces. It is still a migration: verify supported versions, client configuration, connectivity, authentication, and recovery. Keeping the Kafka API does not eliminate destination-side correctness work. AWS describes MSK as a managed Apache Kafka service.
Commercial migration evidence establishes feasibility, not compatibility with your consumers. GFT describes moving an EV-charging company's existing Confluent Cloud stream to Kinesis. Its case does not specify a calendar migration date. The AWS Airties case describes a project initiated in 2023; use its AWS-oriented architecture as context, not proof that your replay contract will survive.
Price the temporary dual operation explicitly: bridge reliability, reconciliation storage, duplicate monitoring, alerts, on-call ownership, and rollback capacity. Maintain one authoritative settlement writer during a reporting pilot. Define who repairs divergent outputs and when the bridge will be retired; otherwise, a cheaper ingestion line can leave an expensive permanent second system.
Mad Devs' Newo.ai case provides context for its Kafka work, not evidence of a Kinesis migration. Its Kafka performance tuning article can help investigate the existing path before assuming a platform change will resolve lag. Carry those findings into the pilot's cost and recovery criteria.
Conclusion
Assign the owner of the strictest consumer contract before approving the stream migration. In this example, reporting can move once its snapshot and replay tests pass; settlement stays on Kafka until history and ledger recovery are proven. Keep additional investigation explicit where evidence is missing. A defensible decision names the consumer, the tested configuration, the recovery result, and the person accepting it. Ingestion economics then informs a decision whose correctness has already been checked.
Backend Development Assess one event stream before migration Mad Devs can map consumer contracts, test replay and duplicate handling, and provide a migration decision for each consumer group. Discuss your event stream → |








