A platform team prices the same event backbone two ways. Amazon MSK with six kafka.m7g.xlarge brokers and seven-day retention comes to $6,323.04 a month on US East (N. Virginia) list prices. The same six m7g.xlarge brokers on EC2, with gp3 volumes holding the same seven days at three replicas, come to $4,343.62. The slide says self-hosting is 31 percent cheaper, and the meeting moves to the migration plan.
One line is missing from that slide. When three replicas sit in three Availability Zones, every record written to a self-managed cluster crosses an AZ boundary twice, and AWS bills cross-AZ traffic at one cent per gigabyte in each direction, at both ends. At 25 MB/s of ingest that is 65,700 GB a month times four cents: $2,628.00 of pure replication traffic. Add it and self-hosting costs $6,971.62 before an engineer is paid to operate it, ten percent more than the cluster it was supposed to undercut.
MSK does not charge for replication between brokers. That sentence is worth more than the premium MSK charges over on-demand EC2, and the point where it decides the bill can be calculated. At seven-day retention and three replicas, cross-AZ replication alone repays the entire broker premium at 15.6 MB/s of sustained ingest on m7g.xlarge brokers, 3.9 MB/s on m7g.large and 62.3 MB/s on m7g.4xlarge. Below the line the premium is larger and the decision turns on engineering hours. Above it, self-hosting loses on bandwidth before labor is counted.
Figure: monthly cost of six kafka.m7g.xlarge brokers at 25 MB/s ingest and seven-day retention, self-hosted on EC2 ($10,011.62 with labor) against Amazon MSK ($6,323.04). Dev.to does not render inline SVG, so view the figure in the original post.
Assumption Box
Prices are US East (N. Virginia) list prices in USD, read on 26 November 2026, on a 730-hour month. MSK rates come from the AWS price list for Amazon MSK published 17 November 2026:
kafka.m7g.large$0.204 per hour,kafka.m7g.xlarge$0.408,kafka.m7g.2xlarge$0.816,kafka.m7g.4xlarge$1.632, storage $0.10 per GB-month, low-cost tier $0.06 per GB-month with $0.0015 per GB retrieval. EC2 rates come from the on-demand feed published 24 November 2026: m7g.large $0.0816 per hour, m7g.xlarge $0.1632, m7g.2xlarge $0.3264, m7g.4xlarge $0.6528. EBS gp3 is $0.08 per GB-month with 3,000 IOPS and 125 MB/s included, and cross-AZ transfer is $0.01 per GB in each direction. Engineering time is carried at $95 per hour fully loaded [assumption], with 20 baseline hours plus 2 hours per broker per month [assumption]. Volumes, partition counts and ingress per broker are [modeled], not measured, and none of the figures is a vendor benchmark.
Where the meters differ
Three meters decide this comparison and they do not move together. MSK bills a broker-hour at 2.5 times the on-demand EC2 rate of the identical instance, then bills storage at $0.10 per GB-month. A self-managed cluster bills the instance at list plus gp3 at $0.08, then pays AWS for the network that keeps three copies of every record. Confluent Cloud bills neither: capacity in elastic Confluent units, and every gigabyte that enters or leaves.
| Decision vector | Amazon MSK Provisioned | Self-hosted Kafka on EC2 | Confluent Cloud Standard |
|---|---|---|---|
| Billing unit | Broker-hour at 2.5x EC2, plus storage | EC2-hour, plus gp3, plus network | eCKU-hour, plus GB in and out, plus storage |
| Replica traffic | Not charged between brokers | $0.01 per GB each way, per AZ crossing | Inside the platform, but throughput drives eCKUs |
| Client traffic across AZs | Standard data transfer | Standard data transfer | $0.035 to $0.050 per GB |
| Scaling step | Next broker size, one per AZ | Resize, rebalance, or add hardware | Automatic, billed in eCKU fractions |
| Staff surface | Topic design and capacity, no OS | Patching, rebalancing, upgrades, on-call | Schema, quotas, network policy |
| Floor before any traffic | $446.76 for three m7g.large | Same EC2 floor plus storage | About $385 at 70 percent utilization |
The floors land within about $62 of each other, so the floor never decides anything. The per-gigabyte meter does. At 25 MB/s the Confluent ingress and egress lines together are $6,077.25, which is 96 percent of MSK's entire bill for the same workload before a single eCKU-hour or gigabyte of storage is charged. At 100 MB/s those two data lines reach $24,309.00, within $1,000 of everything MSK charges at that size. Paying per gigabyte twice is buying operational relief rather than infrastructure, and the relief gets more expensive as the platform gets busier.
The replication arithmetic
Everything downstream reduces to two constants. One megabyte per second sustained for 730 hours is 2,628 GB of ingest. At seven-day retention and three replicas, that same megabyte per second holds 1,814.4 GB on disk, because 604.8 GB of logical history is written three times.
Replication cost follows from the layout. With one replica per zone, each record lands on two followers in two other zones, so each gigabyte ingested generates two cross-AZ transfers, each billed at one cent at the sender and one cent at the receiver: $0.04 per GB, or $105.12 per MB/s per month. Self-hosting saves 2 cents per GB-month on storage, which is $36.29 per MB/s at this retention. The net penalty for self-hosting on the network and storage lines is $68.83 per MB/s per month, and the only offset is the broker premium avoided.
| Broker tier | MSK broker premium per month | Self-hosting net penalty per MB/s | Ingest where replication repays the premium |
|---|---|---|---|
| 3 x kafka.m7g.large | $268.06 | $68.83 | 3.9 MB/s |
| 6 x kafka.m7g.xlarge | $1,072.22 | $68.83 | 15.6 MB/s |
| 6 x kafka.m7g.2xlarge | $2,144.45 | $68.83 | 31.2 MB/s |
| 6 x kafka.m7g.4xlarge | $4,288.90 | $68.83 | 62.3 MB/s |
Read the table as a budget rather than a verdict. The premium avoided is fixed by instance size, while the penalty grows with every megabyte per second that flows, so larger brokers buy more headroom before bandwidth outruns the savings. Nothing here involves a throughput claim or a reference architecture: it is list price multiplied by bytes.
Three footprints and their totals
The scenarios below cover the shapes that reach this decision: a small production pipeline, a growth workload and a large one. Each runs three replicas across three zones with seven-day retention, priced on the broker tier a team would plausibly choose: the three-broker minimum for the small pipeline, six m7g.xlarge carrying about 4 MB/s per broker for the growth cluster, and six m7g.4xlarge carrying about 17 MB/s per broker for the large one. Ingress per broker is a sizing choice to confirm with a load test, not a published limit.
| Monthly cost line | A: 5 MB/s, 3 brokers | B: 25 MB/s, 6 brokers | C: 100 MB/s, 6 brokers |
|---|---|---|---|
| Retained data, RF 3 | 9,072 GB | 45,360 GB | 181,440 GB |
| MSK, flat storage | $1,353.96 | $6,323.04 | $25,292.16 |
| MSK, tiered storage | $1,059.81 | $4,852.31 | $19,409.25 |
| Self-hosted, 3 AZs, before labor | $1,430.06 | $6,971.62 | $27,886.46 |
| Self-hosted, 3 AZs, with labor | $3,900.06 | $10,011.62 | $30,926.46 |
| Self-hosted, 1 AZ of replicas, with labor | $3,374.46 | $7,383.62 | $20,414.46 |
| Confluent Standard, data and storage floor | $2,324.46 | $10,472.55 | $41,123.70 |
The Confluent column needs a caveat the others do not. Its eCKU count is invisible from outside, so the figures use one, two and six eCKUs at 70 percent utilization as [modeled] capacity and add the published $0.05 per GB in, the midpoint $0.0425 per GB out and $0.08 per GB-month of storage. That column is a floor built from public unit rates, not a quote.
Scenario A: five megabytes per second on three brokers
Three kafka.m7g.large brokers on MSK cost $446.76 in broker hours and $907.20 for 9,072 GB, $1,353.96 in total. The self-hosted version is $178.70 of EC2, $725.76 of gp3 and $525.60 of replication, $1,430.06 with nobody on call. Managed is already cheaper, and the ratio explains why: replication costs roughly twice the entire broker premium self-hosting avoided.
Tiered storage moves MSK to $1,059.81 by keeping one day at $0.10 and six days at $0.06, with $16.89 of retrieval for a consumer that reads the archive once. At 26 hours a month self-hosting totals $3,900.06, a gap of $2,546.10, so at this size the question is not whether managed costs more but whether the extra $2,500 buys back the on-call rotation it replaces.
Scenario B: twenty-five megabytes per second on six brokers
This is the shape from the opening paragraph, where the spreadsheet error is most tempting. MSK is $1,787.04 of brokers plus $4,536.00 of storage, $6,323.04. Self-hosted infrastructure is $4,343.62, a 31 percent discount that survives until the network line is added. Replication is $2,628.00, so self-hosting lands at $6,971.62 before labor and $10,011.62 after 32 hours of it: cheaper than managed by $648.58 before labor and more expensive by $3,688.58 after.
Two sensitivities close the case. At 10 hours a month instead of 32, self-hosting falls to $7,921.62 and still loses, because $2,628 of bandwidth exceeds the $1,072.22 premium on its own. With tiered storage MSK drops to $4,852.31 and the gap widens to $2,119.31. At 25 MB/s no labor assumption and no retention tweak reverses the ordering.
Scenario C: one hundred megabytes per second and the single-zone temptation
At 100 MB/s six kafka.m7g.4xlarge brokers cost $7,148.16 in broker hours and $18,144.00 for 181,440 GB, $25,292.16. Self-hosted is $2,859.26 of EC2, $14,515.20 of gp3, $10,512.00 of replication and $3,040 of labor, $30,926.46. The broker premium of $4,288.90 is the largest in this article and less than half the replication bill, which is why the biggest clusters are the least likely to be self-hosted successfully on three zones.
This is where teams redesign the topology instead of the vendor choice. Put every replica in one zone and replication falls to zero; the same cluster then costs $20,414.46 with labor and beats MSK at flat storage by $4,878. The trade is that a zone failure takes the cluster with it. Turn on tiered storage and even that advantage disappears, because $19,409.25 is $1,005 less than the single-zone cluster with its availability intact.
Levers that move the threshold
Tiered storage is MSK's strongest lever at long retention, and its arithmetic is easy to check. At seven-day retention, one day on the $0.10 tier and six on $0.06 cost $25.92 and $93.31 per MB/s per month plus $3.38 of retrieval, $122.61 against $145.15 for the same 1,814.4 GB on gp3. MSK storage then costs less than the EBS it was supposed to lose to, which inverts the usual complaint.
Swap gp3 for st1 on the self-hosted side and the order flips back: at $0.045 per GB-month the same retention costs $81.65 per MB/s, and only then does self-managed storage beat the managed tier. st1 earns that rate by being throughput-oriented, so it suits the cold tail of a retention window and not the hot day. A realistic design keeps the last day on gp3 and the remainder on st1, and the blended rate lands between the two.
Change the layout instead of the storage and the threshold moves further than any discount will. Two replicas across two zones halve the multiplier to $0.02 per GB, or $52.56 per MB/s, and six m7g.xlarge brokers then break even at 65.9 MB/s rather than 15.6. The cost is a replication factor of two, where one restart at the wrong moment can leave a partition under-replicated with no third copy to promote. Teams accept that for derived data such as clickstream and keep three replicas for anything a billing system reads.
Retention length decides which line dominates. A gigabyte of ingest costs $0.04 to replicate and $0.0099 per day to retain on MSK or $0.0079 on gp3, so the lines are equal at 4.1 days on MSK and 5.1 days on gp3, and at thirty days storage is 7.4 times the replication bill. Client traffic is a separate line on both sides: producers next to leaders and follower fetching keep consumer reads in-zone, so client cross-AZ cost can approach zero. Replica traffic cannot, because a leader in zone A must ship every record to zones B and C wherever the clients sit.
Serverless deserves one line. MSK Serverless bills $0.75 per cluster-hour, $0.10 per GB in, $0.05 per GB out and $0.0015 per partition-hour, so 150 partitions cost $711.75 a month before a byte moves, against $446.76 for three kafka.m7g.large brokers and their storage. For always-on pipelines the serverless floor is the more expensive one.
Migration checkpoint: Terraform and Go
If the numbers point to managed, provision it with the settings that keep a later exit cheap: explicit replication factor, no auto topic creation, bounded retention, storage sized from the retention arithmetic rather than the console default. MSK configuration revisions are immutable, so a new revision costs a rolling restart and keeps the ARN.
resource "aws_msk_configuration" "kafka_tuned" { name = "kafka-tuned-r1" kafka_versions = ["3.9.x"] server_properties = <<PROPERTIES auto.create.topics.enable=false default.replication.factor=3 min.insync.replicas=2 unclean.leader.election.enable=false log.retention.hours=168 num.partitions=12 PROPERTIES } resource "aws_msk_cluster" "events" { cluster_name = "events-prod" kafka_version = "3.9.x" number_of_broker_nodes = 6 broker_node_group_info { instance_type = "kafka.m7g.xlarge" client_subnets = var.private_subnets security_groups = [aws_security_group.kafka.id] storage_info { ebs_storage_info { volume_size = 2000 } } } configuration_info { arn = aws_msk_configuration.kafka_tuned.arn revision = aws_msk_configuration.kafka_tuned.latest_revision } } Before any cutover, enumerate what a target cluster would have to reproduce. A short Go program over the Kafka admin API reads retention and partition counts and prices the result with the same constants used above, which is also the audit to run again after a migration and diff.
package main import ( "context" "fmt" "strconv" "time" "github.com/twmb/franz-go/pkg/kadm" "github.com/twmb/franz-go/pkg/kgo" ) const ( gbPerMBsMonth = 2628.0 // 730h x 3600s x 1MB, decimal GB crossAZperGB = 0.04 // two replica hops, $0.01 at each end ) func main() { cl, err := kgo.NewClient(kgo.SeedBrokers("b-1.events-prod:9092"), kgo.ClientID("tco-audit")) if err != nil { panic(err) } defer cl.Close() adm := kadm.NewClient(cl) ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() meta, err := adm.ListTopics(ctx) if err != nil { panic(err) } var retainedGB float64 for _, t := range meta.Sorted() { cfg, err := adm.DescribeTopicConfigs(ctx, t.Topic) if err != nil { continue } hours := 168.0 for _, r := range cfg[0].Configs { if r.Key == "retention.ms" && r.Value != nil { if ms, err := strconv.ParseFloat(*r.Value, 64); err == nil { hours = ms / 3600000 } } } // production reads per-partition size from log dir metrics; 1 GB/day is a placeholder const perPartitionGBDay = 1.0 retainedGB += perPartitionGBDay * (hours / 24) * float64(t.Partitions) * 3 } logicalGB := retainedGB / 3 ingestGBMonth := logicalGB / 604.8 * gbPerMBsMonth // 604.8 GB of history per MB/s at 7 days fmt.Printf("retained GB at RF 3: %.0f\n", retainedGB) fmt.Printf("implied ingest: %.0f GB per month\n", ingestGBMonth) fmt.Printf("self-hosted replication on 3 AZs: $%.2f per month\n", ingestGBMonth*crossAZperGB) } Two parts are deliberately crude: the per-partition volume is a placeholder that production reads from log directory sizes, and the printed replication figure assumes the ingress implied by the retained bytes. Both are places to wire in your own capacity data. What is worth keeping is the retention parse and the multiplication by three, the two numbers that move a cluster across the threshold.
Five practical questions
Does MSK really not charge for replication between brokers?
It does not. The MSK pricing page states there is no charge for data transfer used for replication between brokers or between metadata nodes and brokers, and that standard data transfer applies to data moving in and out of the cluster. Self-managed Kafka has no such clause, so the same replication appears on the EC2 bill at $0.01 per GB in each direction.
Is four cents per gigabyte the right replication multiplier?
It depends on replication factor and zone layout, and nothing else. Three replicas across three zones means two cross-AZ transfers per record, each billed at both ends, or $0.04 per GB. Two replicas across two zones is $0.02. A single-zone layout is zero and loses the failure domain. With rack awareness, the multiplier follows the rack assignment you configured, so read it rather than assume it.
Why does the threshold move with broker size?
Because the premium is a fixed percentage of a growing instance rate while the penalty is fixed per megabyte per second. MSK charges 2.5 times the EC2 rate at every m7g size, so the premium is $268.06 for three m7g.large, $1,072.22 for six m7g.xlarge and $4,288.90 for six m7g.4xlarge. Dividing each by $68.83 per MB/s gives 3.9, 15.6 and 62.3 MB/s. Larger brokers buy headroom, not a different rule.
Can follower fetching or rack awareness remove the cross-AZ cost?
Only for clients. Follower fetching lets a consumer read from an in-zone replica, and producers placed next to leaders remove most remaining client traffic. Replica traffic is not optional: the leader must write to followers in the other zones for the replication factor to mean anything, and those writes cross zones at every record.
What changes if retention is longer than a week?
Storage starts to dominate. A gigabyte of ingest costs $0.04 to replicate across three zones and $0.0099 per day to retain on MSK or $0.0079 on gp3, so the lines are equal at 4.1 and 5.1 days and storage is 7.4 times larger at thirty. Longer retention pushes the crossover outward, which is also where tiered storage earns its place on the managed side.
Sources and scope
Broker, storage, tiered storage, retrieval and throughput rates come from the MSK pricing page and the Amazon MSK price list for us-east-1 published 17 November 2026. EC2 rates come from the on-demand feed published 24 November 2026, EBS rates from the EBS pricing page, and cross-AZ rates from the VPC pricing page and the data transfer section of the EC2 on-demand page. Confluent figures come from its published pricing page. Every scenario volume is modeled from an assumed ingress rate, retention and replication factor; no throughput per broker is claimed and no vendor benchmark is reproduced. The same method applied to object storage egress is in Amazon S3 and CloudFront versus Cloudflare R2, and the managed-versus-self-managed crossover method for compute is in AWS Lambda versus ECS Fargate.