Coder Social home page Coder Social logo

nodefluent / schema-registry Goto Github PK

View Code? Open in Web Editor NEW
24.0 9.0 3.0 111 KB

:orange_book: json & avro http schema registry backed by Kafka

License: MIT License

JavaScript 99.35% Shell 0.65%
kafka schema registry schema-registry rest node avro json

schema-registry's Introduction

node-schema-registry

Greenkeeper badge

Build Status

DISCLAIMER: We encourage you to keep your topics dynamic and JSON only, when choosing to go the Node.js Kafka way. Therefore we are no longer adding features to this registry project. When you are looking for a typed (schema-requirement) approach we suggest using Confluent's schema-registry with AVRO.

  • in BETA ๐ŸŒฑ
  • avro & json schema registry backed by Kafka ๐Ÿ™
  • API similar to confluentinc's schema-registry
  • enhances the experience of node-kafka-streams
  • enables node-kafka-connect
  • might also be used in a Kafka unrelated field โญ
  • ships with a neat RegistryClient
  • checkout API Quickstart
  • compatibility options are currently disabled
  • LivingAvroSchema and LivingJsonSchema allow for real-time schema updates in running services

What is a Schema Registry?

Schema Registry provides a serving layer for your metadata. It provides a RESTful interface for storing and retrieving Avro schemas. It stores a versioned history of all schemas, provides multiple compatibility settings and allows evolution of schemas according to the configured compatibility setting. It provides serializers that plug into Kafka clients that handle schema storage and retrieval for Kafka messages that are sent in the Avro format.

Code Wise (Dev)

npm install --save schema-registry
const {RegistryClient, Registry, LivingAvroSchema} = require("schema-registry");
const registryClient = new RegistryClient({port: 1337});
registryClient.getLatestSubjectSchema("test-subject").then(schema => {..});

Living Schemas

const {LivingAvroSchema} = require("schema-registry");
const livingSchema = new LivingAvroSchema("test", "latest", {port: 1337});
livingSchema.on("new-version", console.log);
livingSchema.fetch().then(_ => {
    const buffer = livingSchema.toBuffer(someObject);
    const equalToSomeObject = livingSchema.fromBuffer(buffer);
});

Run a Registry (Ops) (Quicksetup)

npm install -g schema-registry
# you will need zookeeper + kafka (checkout `/kafka-setup/start.sh`
# if you dont have them)
# node-schema-registry -h
node-schema-registry -p 1337 -z localhost:2181/ -t _node_schema -l info

Using the registry CLI Client

nsrc --host localhost -p 1337 -e getSchemaById -a e707463d-0c3d-4010-afed-0d53c77e3605 -v

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.