Certopolis

AWS Certified Solutions Architect – Associate

Kinesis Data Streams vs Data Firehose: which to use

Kinesis Data Streams holds records for your own consumers to read in real time, typically under a second after they are written, and keeps them for 24 hours by default and up to 365 days so they can be read again. Amazon Data Firehose (formerly Kinesis Data Firehose) needs no consumer code: it buffers records and delivers them to destinations such as S3, Redshift, OpenSearch Service or Splunk. When you need both, point a Firehose stream at the data stream.

Kinesis Data Streams

A data stream is a set of shards. Each shard accepts up to 1,000 records or 1 MB per second of writes, and serves up to 2 MB per second of reads. A partition key decides which shard a record goes to. Records are typically readable less than a second after they are written.

Several applications can read the same stream at the same time and independently, for example one computing aggregates and one archiving to S3. Consumers are usually built with the Kinesis Client Library. Retention defaults to 24 hours and can be raised to 8,760 hours (365 days), at extra cost.

In on-demand mode, Kinesis manages the shards and you pay for the throughput you use. In provisioned mode, you set the shard count and pay per shard per hour.

Data Streams now also has a data delivery feature that copies a stream to general purpose S3 buckets or to Apache Iceberg tables on S3 Tables within minutes, with no consumer to run. Firehose covers far more destinations and adds Lambda transforms and format conversion.

Amazon Data Firehose

Firehose is fully managed delivery. You do not write applications or manage resources. Destinations include Amazon S3, Amazon Redshift, Amazon OpenSearch Service, OpenSearch Serverless, Splunk, Apache Iceberg Tables and HTTP endpoints. For Redshift, Firehose writes to S3 first and then runs a COPY command.

Firehose buffers records until a size or time limit is reached, whichever comes first. For S3 the buffer is 1 to 128 MB (default 5) and 0 to 900 seconds (default 300). A zero-second interval delivers within a few seconds, but it is not available with dynamic partitioning.

Firehose can call a Lambda function to transform records, with up to 5 minutes per invocation. It can convert JSON to Apache Parquet or ORC before writing to S3, using a schema in the AWS Glue Data Catalog. A Firehose stream can read from an existing Kinesis data stream.

Where the exam catches people

  • Believing Firehose lets a team read records within milliseconds or replay them: it buffers and delivers; real-time reads and replay come from Data Streams.
  • Believing a data stream keeps data for at most 7 days: retention can be raised to 8,760 hours, which is 365 days.
  • Believing a Firehose transform can run for 15 minutes because Lambda can: Firehose allows up to 5 minutes per invocation.
  • Believing Firehose converts any input to Parquet: it converts JSON, using a schema in the AWS Glue Data Catalog.

Written from Amazon Web Services's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A team must land clickstream records in Amazon S3 and Amazon OpenSearch Service continuously, with no consumer application to write or scale, and is willing to accept delivery in batches rather than instantly. Which solution meets these requirements?

    Right. In the game that’s Renown for your Design High-Performing Architectures building.

    Not that one: B is right. In the game your Design High-Performing Architectures building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    "Amazon Data Firehose is a fully managed service for delivering real-time streaming data to destinations such as Amazon Simple Storage Service (Amazon S3), Amazon Redshift, Amazon OpenSearch Service... With Amazon Data Firehose, you don't need to write applications or manage resources. You configure your data producers to send data to Amazon Data Firehose, and it automatically delivers the data to the destination that you specified." And batching: "Amazon Data Firehose buffers incoming streaming data to a certain size or for a certain period of time before delivering it to destinations. Buffer Size is in MBs and Buffer Interval is in seconds." The willingness to accept batches is what makes Firehose rather than a stream the right answer.

    Written from docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html

  2. An analytics team needs streaming records in Amazon S3 with no consumer code, and a separate fraud team needs to read the same records within milliseconds and replay the last day of them after a model change. A solutions architect must serve both from one ingestion path. Which approach will meet these requirements?

    Right. In the game that’s Renown for your Design High-Performing Architectures building.

    Not that one: D is right. In the game your Design High-Performing Architectures building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    And it "buffers incoming streaming data to a certain size or for a certain period of time before delivering it", which is why it cannot serve millisecond reads or replay. The composition is documented on the same page: "You can also configure your Firehose stream to automatically read data from an existing Kinesis data stream, and load it into destinations." That leaves the data stream as the real-time, replayable source for the fraud team's own consumer, with Firehose attached to it for the analytics team's delivery.

    Written from docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html

  3. A regulated workload must be able to replay a Kinesis data stream for up to a year, and the team asks whether the stream itself can hold records that long or whether the data has to be copied elsewhere for replay. Which approach will meet these requirements?

    Right. In the game that’s Renown for your Design High-Performing Architectures building.

    Not that one: A is right. In the game your Design High-Performing Architectures building would lose a little Renown, and this question would come back later.