Code Monkey home page Code Monkey logo

changestream's Introduction

Changestream

CircleCI codecov

Changestream sources object-level change events from a MySQL Replication Master (configured for row-based replication) by streaming the MySQL binlog and transforming change events into JSON strings that can be published anywhere.

Currently, Amazon Simple Queuing Service (SQS), Amazon Simple Notification Service and Amazon S3 are supported with optional client-side message encryption via AES.

Documentation

Getting Started

Requirements

Setup

First, start MySQL with

docker-compose up

(or, for the hard way without Docker, follow the bespoke setup instructions).

You will then have access to a MySQL instance on localhost port 3306 with a root password of "password", and Changestream configured to listen for events.

Changestream is available on Docker Hub.

Then build and run Changestream using the sbt CLI:

$ sbt run

Building

Docker Image (requires a docker host to build)

Note: The Dockerfile will be written to target/docker/Dockerfile, and the docker image will be added to your local docker repo.

$ sbt docker

Debian Package (requires dpkg-deb, written to target/*.deb)

$ sbt debian:packageBin

Jar Package (written to target/scala-2.11/*.jar)

$ sbt package

Contributing

Testing

Changestream is 100% unit and integration tested, with end-to-end testing on CircleCI with MySQL and Amazon SNS.

Mysql Test Config

In order to run tests locally you need to configure test.conf with a working MySQL connection configuration.

Make sure that your test user has permissions to create and drop databases and tables. By default, Changestream uses the changestream_test table for tests.

AWS Test Config

To run the integration tests, as well as the unit tests on the SqsActor and SnsActor, you also need to ensure that you have configured your AWS tokens to be available from the environment, and that your AWS tokens have access to create and add messages to queues (SQS) and create and publish to topics (SNS).

AWS_ACCESS_KEY_ID=<access_key_id>
AWS_SECRET_ACCESS_KEY=<secret_access_key>
AWS_REGION=<your_region>
AWS_S3_BUCKET=<your_bucket>
AWS_S3_KEY_PREFIX=<some_key_prefix>

Running Tests

Once that's all set up, you can either run

$ sbt test

from the command line, or run the test command in IntelliJ (with the Scala and SBT plugins installed).

ScalaStyle

Changestream uses ScalaStyle for code linting--it is not automatic. Before submitting a PR, please take a look at the output of the sbt scalastyle command and correct any issues you find.

License

Changestream is available under the MIT License.

Authors

Peter Fry (@racerpeter) and the Mavengineering team.

Inspiration

Changestream was inspired in a large part by mardambey/mypipe by Hisham Mardam-Bey. The first proof-of-concept for changestream was a fork of mypipe - thank you Hisham.

changestream's People

Contributors

racerpeter avatar arthurlm44 avatar lambdatastic avatar ahuth avatar salehrastani avatar diclophis avatar redjohn avatar

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.