Code Monkey home page Code Monkey logo

teleporter's Introduction

Teleporter

Teleporter is a realtime dynamic data process frameworks. It's follow reactive-streams specification, use akka-streams as data process engine, So it have a high performance for a single streams, It's based on akka, so single machine can support thousands streams, and it's provider a distributed manager, so a cluster can support millions streams.

Now support: kafka, jdbc, kudu, mongo, elasticsearch, hdfs, hbase

Quickstart

  • broker

    Is a config manager, task manager. It's contains a ui, default:(http://localhost:9021)

  • instance

    The execute engine, for run data process task.

UI config
  • namespace
    • broker - define all broker, for master-master
    • instance - Every instance must have a unique key
    • group - many-to-many for task and instance relation
    • task - It contain many streams
      • partition - Split task use tail regex for task streams, like: /stream/ns/task/stream11.*
      • stream - the real task execute unit, default is a scala script write by akka-streams.
        • source - akka-steams source, or like jdbc,kafka source for data read
        • sink - akka-streams sink, for data write
    • address - data address, like database, kafka...
    • variable - a public variable refer

All node can refresh, and all instance will be dynamic refresh. User defined exception process. Pattern errorMessage Regex match : (DEBUG|INFO|WARN|ERROR) => Action action rule like retry(delay = 1.minutes, retries = 3, next = stop) support main process rules:

  • stream

    start, stop, restart

  • source

    reload, retry, resume, stop

  • sink

    reload, retry, resume, stop

Next will collect error metrics on UI for monitor.

Install

for linux:

/bin/teleporter.sh start broker

It's will auto find config from broker and run it, All can config, You don't write any logic in this.

/bin/teleporter.sh start instance

or for local dev

/bin/teleporter.sh start local

dev ui: ui install

ng serve --proxy-config proxy.conf.json

#####broker It's contains config manager, streams dynamic updated, It's use a scala script for a streams logic which write In akka streams, Only implement a function: (key: String, center: TeleporterCenter) ⇒ (KillSwitch, Future[Done]), like this:

object StreamExample extends StreamLogic {
  override def apply(key: String, center: TeleporterCenter): (KillSwitch, Future[Done]) = {
    import center.{materializer, self}
    Jdbc.sourceAck("/source/ns/task/stream/source")
      .map(_.map(data  Seq(Upsert(
        updateSql("table_name", "id", data),
        insertIgnoreSql("table_name", data)
      ))).toMessage)
      .via(Jdbc.flow("/source/ns/task/stream/sink"))
      .via(SourceAck.confirmFlow())
      .viaMat(KillSwitches.single)(Keep.right).watchTermination()(Keep.both)
      .to(Sink.ignore).run()
  }
}

Or it's can make a template for zero code. And other standrd config is defined on UI, So it's easy config. UI use angular2 dynamic form, So it's add config UI by config.Every client only use one tcp connection for all thing with broker for high performance. Every client keep connection for multi broker and don't have a master for high available. Don't use listener for config change event. Use the trigger for change. The store is easy change. Because config is only use KV store. change store only implement one interface only 4 method. Default use leveldb, but it's easy use other database. Metrics use influxdb show as chartjs, this statistics rate, error count etc.

Instance

instance is only a executor streams. Write back state. Give the instance a unique key, and then config the relation for task on UI. It's will auto exec.

Metrics

Use influxdb as metrics storage. Storage format:

  • simple count

    Use at source and sink: key start=1493439,end=1339493,count=39483

  • error count

    key,status=ERROR,level=(DEBUG|INFO|WARN|ERROR) start=1493439,end=1339493,count=39483

##About The idea from camel and spring integration, and I will use akka-streaming, reactive-streams-jvm Every stream has source, flow, sink. source sink is elso the publisher and subscribe. So I will make every thing like this. simple,flexibility and powerful.

Diagram

Alt Text Alt Text

teleporter's People

Contributors

huanwuji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

lupingqiu

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.