# Logging millions of requests reliably with our new data ingestion pipeline

DevFeed: [Logging millions of requests reliably with our new data ingestion pipeline](<https://devfeed.tech/articles/logging-millions-of-requests-reliably-with-our-new-data-ingestion-pipeline-20018.md>)

Original publisher: [Read original article](<http://engineering.hackerearth.com/2022/07/01/logging-millions-of-requests-reliably-with-our-new-data-ingestion-pipeline/>)

Published: 2022-07-01T00:00:00Z

Content type: article

Language: en

Sources: [HackerEarth](<https://devfeed.tech/sources/hackerearth.md>)

Topics: [Analytics Pipeline](<https://devfeed.tech/topics/analytics-pipeline.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>), [streaming data analytics](<https://devfeed.tech/topics/streaming-data-analytics.md>), [Web app](<https://devfeed.tech/topics/webapp.md>), [Amazon S3](<https://devfeed.tech/topics/amazon-s3.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [API Logging](<https://devfeed.tech/topics/api-logging.md>)

Tags: [amazon-kinesis](<https://devfeed.tech/tags/amazon-kinesis.md>), [analytics-pipeline](<https://devfeed.tech/tags/analytics-pipeline.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [compress](<https://devfeed.tech/tags/compress.md>), [cost](<https://devfeed.tech/tags/cost.md>), [data](<https://devfeed.tech/tags/data.md>), [data-ingestion](<https://devfeed.tech/tags/data-ingestion.md>), [data-ingestion-pipeline](<https://devfeed.tech/tags/data-ingestion-pipeline.md>), [database](<https://devfeed.tech/tags/database.md>), [flow](<https://devfeed.tech/tags/flow.md>), [http](<https://devfeed.tech/tags/http.md>), [https](<https://devfeed.tech/tags/https.md>), [kinesis](<https://devfeed.tech/tags/kinesis.md>), [logging](<https://devfeed.tech/tags/logging.md>), [managed](<https://devfeed.tech/tags/managed.md>), [minutes](<https://devfeed.tech/tags/minutes.md>), [operational](<https://devfeed.tech/tags/operational.md>), [overhead](<https://devfeed.tech/tags/overhead.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [query](<https://devfeed.tech/tags/query.md>)

## AI overview

HackerEarth replaced a complex, self-hosted request logging system with Amazon Kinesis Firehose delivery to Redshift, using retries to protect against intermittent component failures and reporting data availability within 10-15 minutes. As request volume grew, Redshift costs led the team to retain only 12 months there, reducing analyst access to historical logs. The article describes querying compressed hourly log files in S3 with serverless Athena instead. Athena's partition projection uses the S3 date-hour path, and queries must filter on the projected datehour column to limit scanned data and improve speed and cost. Athena workgroups can cancel queries that exceed scan limits; Athena also retains query results in S3 for 45 days, allowing eligible reruns to return stored results. The account presents these as ways to manage storage and query costs while accessing longer-term logs, but gives no quantified savings.

## Source excerpt

Introduction HackerEarth handles millions of requests every day. To understand the user access patterns, get the usage of any particular feature or a page, figure out the daily active users or users who have been active for the past 6 months, etc in near real time, it is important to stream that data from across different services and ingest it to the analytics pipeline reliably. Problem Our old request logging architecture was complex and has many moving components. There were a lot of operational overheads involved in maintaining and scaling each of those components independently to ensure that all the self-hosted components were up and running all the time. Architecture Solution Last year, we revamped the way we log our web requests. It was done mainly to increase the reliability in logging the HTTP/HTTPS request data from across web services and also to reduce the operational overheads and the infrastructure cost associated with it. The new flow is making use of Kinesis Firehose data streams to deliver the request data from our web servers to Redshift (the database that we use to log and query request data) reliably with much lower cost. Amazon Kinesis Firehose is a fully managed service that automatically scales to match the throughput of our incoming request log data and requires no ongoing administration. It also allows us to compress and encrypt the data before loading it, minimizing the amount of storage used at the destination with increased security and we only need to pay for the amount of data we transmit through the service. The new flow is a fully managed solution with almost no operational overhead. We tried to keep the flow simple and straightforward with less number of moving components. The request data is now guaranteed to appear in the Redshift table within 10-15 minutes from the point we received a request at our web server's end. There are retries configured between consecutive infra components in the new flow to make sure there are no message