Code Monkey home page Code Monkey logo

target-kinesis's Introduction

target-kinesis

A Singer target that propagate data to Amazon Kinesis and Amazon Kinesis Data Firehose streams.

How to use it

target-kinesis works together with any other Singer Tap to move data from sources to Kinesis or Kinesis Firehose stream.

Install and Run

First, make sure Python 3 is installed on your system or follow these installation instructions for Mac or Ubuntu.

It's recommended to use a virtualenv:

 python3 -m venv ~/.virtualenvs/target-kinesis
 source ~/.virtualenvs/target-kinesis/bin/activate
 pip install -U pip setuptools
 pip install -e '.[dev]'

target-kinesis can be run with any Singer Tap, it simply propagate records encoded using the Singer format to a Kinesis or Kinesis Firehose stream.

Optional Configuration

target-kinesis requires configuration file that contains parameters to connect to AWS environment.

Here is an example of required configuration:

{
  "stream_name": "YOUR_KINESIS_STREAM_NAME",
  "aws_access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
  "aws_secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
  "region": "YOUR_AWS_REGION",
  "is_firehose": true,
  "record_chunks": 10,
  "data_chunks": 1000
}

Also available inside config.sample.json

To run target-kinesis with the configuration file, use this command:

› tap-foobar | target-kinesis --config my-config.json

Run test suite

pytest -p no:warnings --cov=target_kinesis tests/test_target.py --cov-report=html

target-kinesis's People

Contributors

zenkay avatar zuc avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

target-kinesis's Issues

The code doesn't handle records bigger than 1MB

Here is an example of error:

botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the PutRecord operation: 1 validation error detected: Value 'java.nio.HeapByteBuffer[pos=0 lim=3919675 cap=3919675]' at 'record.data' failed to satisfy constraint: Member must have length less than or equal to 1024000

Improve performances and logging of Kinesis connection

According to documentation the optimal size for a Kinesis Firehose record in London region is between 1kB and 1MB. Less than 1kB and you won't reach the 1000 record limit, more than 1MB is over the limit.

At the moment the library sends one Kinesis record for each received input record. I want to add logic to aggregate small records in a single call up to the ideal size trying to improve the performances.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.