惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
爱范儿
爱范儿
罗磊的独立博客
V
V2EX
量子位
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园 - 叶小钗
小众软件
小众软件
博客园 - 【当耐特】
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Kinesis Data Firehose Is Not a Silver Bullet: How Undocum...
Dinesh_gowtham · 2026-06-17 · via DEV Community

Dinesh_gowtham

Our real-time data pipeline was failing due to mysterious throughput limits. The culprit? A little-known Kinesis Data Firehose limitation that has nothing to do with shards or provisioned throughput. In this scenario, we expose the undocumented partition key limit that nobody talks about.

Introduction to Kinesis Data Firehose

Kinesis Data Firehose is a fully managed service that captures, transforms, and loads data into Amazon S3, Amazon Redshift, Amazon Elasticsearch, and Splunk. It's commonly used for real-time data processing and analytics.

import { PutRecordCommand } from '@aws-sdk/client-kinesis';
import { KinesisClient } from '@aws-sdk/client-kinesis';

const kinesisClient = new KinesisClient({ region: 'us-west-2' });
const command = new PutRecordCommand({
  StreamName: 'my-stream',
  Records: [
    {
      Data: Buffer.from('Hello World'),
      PartitionKey: 'pk-1',
    },
  ],
});

kinesisClient.send(command).then((data) => {
  console.log(data);
}).catch((err) => {
  console.error(err);
});

Be aware that Kinesis shard limits (1MB/s write, 2MB/s read) can catch teams off-guard at scale. For example, the following error may occur:
ProvisionedThroughputExceededException: Rate exceeded for shard id ... in stream ... under account ...

The Mysterious Throughput Limit

We were experiencing a throughput limit in our real-time analytics pipeline, but it wasn't related to the Kinesis shard limits. The error message was InternalFailure: Internal server error, which wasn't very informative.

import { PutRecordCommand } from '@aws-sdk/client-kinesis';
import { KinesisClient } from '@aws-sdk/client-kinesis';

const kinesisClient = new KinesisClient({ region: 'us-west-2' });
const command = new PutRecordCommand({
  StreamName: 'my-stream',
  Records: [
    {
      Data: Buffer.from('Hello World'),
      PartitionKey: 'pk-1',
    },
  ],
});

kinesisClient.send(command).then((data) => {
  console.log(data);
}).catch((err) => {
  console.error(err);
  if (err.name === 'InternalFailure') {
    console.log('Internal server error occurred');
  }
});

When dealing with Kinesis errors, remember that GetRecords returns empty even when data exists due to eventual propagation. This can lead to confusing behavior if not properly handled.

Partition Key Limits: The Hidden Culprit

After further investigation, we discovered that Kinesis Data Firehose has a fixed limit of 1000 active partition keys. This limit can cause throughput limits and record failures if not properly handled.

import { PutRecordCommand } from '@aws-sdk/client-kinesis';
import { KinesisClient } from '@aws-sdk/client-kinesis';

const kinesisClient = new KinesisClient({ region: 'us-west-2' });
const command = new PutRecordCommand({
  StreamName: 'my-stream',
  Records: [
    {
      Data: Buffer.from('Hello World'),
      PartitionKey: 'pk-1001', // exceeds the limit
    },
  ],
});

kinesisClient.send(command).then((data) => {
  console.log(data);
}).catch((err) => {
  console.error(err);
  if (err.name === 'KinesisException') {
    console.log('Partition key limit exceeded');
  }
});

Be aware that shard iterator expiration after 5 minutes can cause consumer failures. This can be mitigated by periodically renewing the iterator.

Redesigning the Pipeline

To avoid the partition key limit, we redesigned our pipeline to use a hashing function that distributes the partition keys across multiple streams.

import { PutRecordCommand } from '@aws-sdk/client-kinesis';
import { KinesisClient } from '@aws-sdk/client-kinesis';
import * as crypto from 'crypto';

const kinesisClient = new KinesisClient({ region: 'us-west-2' });
const hashingFunction = (data: string) => {
  const hash = crypto.createHash('sha256');
  hash.update(data);
  return hash.digest('hex').slice(0, 10);
};

const command = new PutRecordCommand({
  StreamName: 'my-stream',
  Records: [
    {
      Data: Buffer.from('Hello World'),
      PartitionKey: hashingFunction('Hello World'),
    },
  ],
});

kinesisClient.send(command).then((data) => {
  console.log(data);
}).catch((err) => {
  console.error(err);
});

When redesigning the pipeline, remember that Kinesis doesn't support message filtering like SQS/EventBridge. This can lead to increased processing costs if not properly handled.

Best Practices for Avoiding the Partition Key Trap

To avoid the partition key limit, follow these best practices:

  • Use a hashing function to distribute the partition keys across multiple streams.
  • Monitor the partition key count and adjust the hashing function accordingly.
  • Use a combination of Kinesis streams and Lambda functions to process and transform the data.
import { PutRecordCommand } from '@aws-sdk/client-kinesis';
import { KinesisClient } from '@aws-sdk/client-kinesis';
import * as crypto from 'crypto';

const kinesisClient = new KinesisClient({ region: 'us-west-2' });
const hashingFunction = (data: string) => {
  const hash = crypto.createHash('sha256');
  hash.update(data);
  return hash.digest('hex').slice(0, 10);
};

const command = new PutRecordCommand({
  StreamName: 'my-stream',
  Records: [
    {
      Data: Buffer.from('Hello World'),
      PartitionKey: hashingFunction('Hello World'),
    },
  ],
});

kinesisClient.send(command).then((data) => {
  console.log(data);
}).catch((err) => {
  console.error(err);
});

Be aware that require(esm) in Node 22 breaks existing Lambda layers silently. This can lead to unexpected behavior if not properly handled.

The Takeaway

Here are some key takeaways from our experience with Kinesis Data Firehose:

  • Kinesis Data Firehose has a fixed limit of 1000 active partition keys, which can cause throughput limits and record failures if not properly handled.
  • Use a hashing function to distribute the partition keys across multiple streams to avoid the limit.
  • Monitor the partition key count and adjust the hashing function accordingly.
  • Be aware of Kinesis shard limits (1MB/s write, 2MB/s read) and shard iterator expiration after 5 minutes.
  • Use a combination of Kinesis streams and Lambda functions to process and transform the data, but be aware of the limitations of Lambda@Edge and provisioned concurrency costs.

Transparency notice

AI-crafted with Groq, powered by LLaMA 3.3 70B.
The topic was scouted from live AWS and Node.js ecosystem signals, and the content —
including all code examples — was written autonomously without human editing.

Published: 2026-06-17 · Primary focus: Kinesis

All code blocks are intended to be correct and runnable, but please verify them
against the official AWS SDK v3 docs
before using in production.

Find an error? Drop a comment — corrections are always welcome.