All Projects → mirusresearch → firehoser

mirusresearch / firehoser

Licence: MIT license
A wrapper around AWS Kinesis Firehose with retry logic and custom queuing behavior. Requires node >= 6.0.0

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to firehoser

Sql Runner
Run templatable playbooks of SQL scripts in series and parallel on Redshift, PostgreSQL, BigQuery and Snowflake
Stars: ✭ 68 (+209.09%)
Mutual labels:  redshift
Fluentmigrator
Fluent migrations framework for .NET
Stars: ✭ 2,636 (+11881.82%)
Mutual labels:  redshift
starlake
Starlake is a Spark Based On Premise and Cloud ELT/ETL Framework for Batch & Stream Processing
Stars: ✭ 16 (-27.27%)
Mutual labels:  redshift
Locopy
locopy: Loading/Unloading to Redshift and Snowflake using Python.
Stars: ✭ 73 (+231.82%)
Mutual labels:  redshift
Aws Data Wrangler
Pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).
Stars: ✭ 2,385 (+10740.91%)
Mutual labels:  redshift
firehose exporter
Cloud Foundry Firehose Prometheus exporter
Stars: ✭ 27 (+22.73%)
Mutual labels:  firehose
Terraform Aws Redshift
Terraform module which creates Redshift resources on AWS
Stars: ✭ 36 (+63.64%)
Mutual labels:  redshift
simple-ddl-parser
Simple DDL Parser to parse SQL (HQL, TSQL, AWS Redshift, BigQuery, Snowflake and other dialects) ddl files to json/python dict with full information about columns: types, defaults, primary keys, etc. & table properties, types, domains, etc.
Stars: ✭ 76 (+245.45%)
Mutual labels:  redshift
Yuniql
Free and open source schema versioning and database migration made natively with .NET Core.
Stars: ✭ 156 (+609.09%)
Mutual labels:  redshift
pytest-mock-resources
Pytest Fixtures that let you actually test against external resource (Postgres, Mongo, Redshift...) dependent code.
Stars: ✭ 84 (+281.82%)
Mutual labels:  redshift
Udacity Data Engineering
Udacity Data Engineering Nano Degree (DEND)
Stars: ✭ 89 (+304.55%)
Mutual labels:  redshift
Go Sct
A color temperature setting library and CLI that operates in a similar way to f.lux and Redshift.
Stars: ✭ 112 (+409.09%)
Mutual labels:  redshift
DoAbsolute
📦 Automate Absolute Copy Number Calling using 'ABSOLUTE' package
Stars: ✭ 26 (+18.18%)
Mutual labels:  firehose
Luigi Warehouse
A luigi powered analytics / warehouse stack
Stars: ✭ 72 (+227.27%)
Mutual labels:  redshift
tipoca-stream
Near real time cloud native data pipeline in AWS (CDC+Sink). Hosts code for RedshiftSink. RDS to RedshiftSink Pipeline with masking and reloading support.
Stars: ✭ 43 (+95.45%)
Mutual labels:  redshift
Ddlparse
DDL parase and Convert to BigQuery JSON schema and DDL statements
Stars: ✭ 52 (+136.36%)
Mutual labels:  redshift
aws-vpc-flow-log-appender
Sample code to append additional information (e.g. Security Group IDs and geolocation data) to VPC Flow Logs for analysis in Elasticsearch.
Stars: ✭ 84 (+281.82%)
Mutual labels:  aws-kinesis-firehose
Hello-AWS-Data-Services
Sample code for AWS data service and ML courses on LinkedIn Learning
Stars: ✭ 144 (+554.55%)
Mutual labels:  redshift
go-localstack
Go Wrapper for using localstack
Stars: ✭ 56 (+154.55%)
Mutual labels:  redshift
Rin
Rin is a Redshift data Importer by SQS messaging.
Stars: ✭ 27 (+22.73%)
Mutual labels:  redshift

Firehoser is no longer being maintained at this time. If someone would like to step in and take over the project please reply to Issue #11

firehoser

A friendly wrapper around AWS Kinesis Firehose with retry logic and custom queuing behavior. Get your data from node into S3 or Redshift in as easy a manner as possible.

Please Note: Firehoser is written in es6 and needs node.js ≥ 6.0

Installation

yarn add firehoser or npm install firehoser

Usage

To use Firehoser, you need to create an instance of a DeliveryStream. There are several variations, but they all expose the same API: putRecord and it's pluralized counterpart putRecords.

The basic DeliveryStream only requires a single argument, which is the name of the delivery stream:

var AWS = require('aws-sdk');
var firehoser = require('firehoser')

AWS.config.update({
  accessKeyId: 'hardcoded-credentials',
  secretAccessKey: 'are-not-a-good-idea'
});

let firehose = new firehoser.DeliveryStream('my_delivery_stream_name');

// Send a single record to Kinesis Firehose...
firehose.putRecord('value1|value2|value3');

putRecords behaves identically to putRecord except that the former accepts an Array of records.

// Send multiple records...
firehose.putRecords([
  'value1|value2|value3',
  'valueX|valueY|valueZ',
]);

Both putRecord and putRecords return a Promise which resolve once the data has been successfully accepted by AWS. If the rate at which you call them exceeds the capacity of the delivery stream to which you are sending them, they will continue to retry the send until they succeed, and only then will the promise resolve.

Amazon Kinesis Firehose limits the number of records you can send at a single time to 500. Firehoser automatically chunks your records into batches of 400 to stay well below this limit.

A common use case for Firehose is to send JSON data into Redshift (or even just S3). This is easily accomplished by using a JSONDeliveryStream:

let firehose = new firehoser.JSONDeliveryStream('my_delivery_stream_name');

firehose.putRecord({
  jsonIs: 'a cool format',
  itMakes: 'pipe-separated values look so dated.'
});

firehose.putRecords([
  {a: 1},
  {a: 2},
  {a: 3}
]).then(()=>{
  console.log("Cool!");
});

Both DeliveryStream and JSONDeliveryStream will immediately send data to AWS Kinesis Firehose as soon as (and as often as) you call putRecord. Sometimes what you want instead is to queue up records as they are generated, and only send them to AWS Kinesis Firehose once a certain number of them have been gathered, or a certain time limit has passed. For these cases, we've created QueueableDeliveryStream and QueueableJSONDeliveryStream. Simply pass in a cutoff value for the number of records, or the staleness of records that you're comfortable with, and we'll wait until one of those limits is passed before sending off the data.

let maxDelay = 15000; // milliseconds
let maxQueued = 100;
let firehose = new firehoser.QueueableJSONDeliveryStream(
  'my_delivery_stream_name',
  maxDelay,
  maxQueued
);

firehose.putRecord({
 id: 'rec1'
}).then(()=>{
  console.log('rec1 sent to AWS!');
});

firehose.putRecord({
  id: 'rec2'
}).then(()=>{
  console.log('rec2 sent to AWS!');
});

//  ... wait ~15 seconds and see both console messages fire at the same time!

Misc

Take off, ya hoser!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].