All Projects → diegobernardes → Flare

diegobernardes / Flare

Licence: bsd-3-clause
Flare is a service that notify changes of HTTP endpoints

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Flare

Samples
Community driven repository for Dapr samples
Stars: ✭ 104 (-5.45%)
Mutual labels:  service, pubsub
Falcon
The no-nonsense REST API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
Stars: ✭ 8,654 (+7767.27%)
Mutual labels:  api, microservices
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+7571.82%)
Mutual labels:  api, microservices
Builder
Prepare your Laravel apps incredibly fast, with various commands, services, facades and boilerplates.
Stars: ✭ 1,009 (+817.27%)
Mutual labels:  api, notifications
X
新生命X组件,数据中间件XCode、日志、网络、RPC、序列化、缓存、Windows服务
Stars: ✭ 1,322 (+1101.82%)
Mutual labels:  api, service
Arduino Nats
An Arduino / ESP8266 / Particle Photon compatible C++ library for communicating with a NATS (http://nats.io) server
Stars: ✭ 44 (-60%)
Mutual labels:  microservices, pubsub
Gravitee Gateway
Gravitee.io - API Management - OpenSource API Gateway
Stars: ✭ 1,123 (+920.91%)
Mutual labels:  api, microservices
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (-78.18%)
Mutual labels:  microservices, service
Chi
lightweight, idiomatic and composable router for building Go HTTP services
Stars: ✭ 10,581 (+9519.09%)
Mutual labels:  api, microservices
Health Checks Api
Standardize the way services and applications expose their status in a distributed application
Stars: ✭ 78 (-29.09%)
Mutual labels:  api, microservices
Caluma
A collaborative form editing service
Stars: ✭ 40 (-63.64%)
Mutual labels:  api, service
Httpbin
HTTP Request & Response Service, written in Python + Flask.
Stars: ✭ 10,423 (+9375.45%)
Mutual labels:  api, service
Jdonframework
Domain-Driven-Design Pub/Sub Domain-Events framework
Stars: ✭ 978 (+789.09%)
Mutual labels:  microservices, pubsub
Node Typescript Boilerplate
Minimalistic project template to jump start a Node.js back-end application in TypeScript. ESLint, Jest and type definitions included.
Stars: ✭ 1,061 (+864.55%)
Mutual labels:  microservices, service
Copper
Copper is a set of Go packages that help you build backend APIs quickly and with less boilerplate.
Stars: ✭ 35 (-68.18%)
Mutual labels:  api, service
Djaoapp
User login, billing, access control as part of a session proxy
Stars: ✭ 61 (-44.55%)
Mutual labels:  api, subscription
Graphiti
Stylish Graph APIs
Stars: ✭ 783 (+611.82%)
Mutual labels:  api, microservices
Zato
ESB, SOA, REST, APIs and Cloud Integrations in Python
Stars: ✭ 889 (+708.18%)
Mutual labels:  api, microservices
Graphql Microservices
Showcasing a graphql microservice setup
Stars: ✭ 68 (-38.18%)
Mutual labels:  api, microservices
Api2html
Using the data from your API, generate the HTML on the fly! Server-side rendering of the mustache templates
Stars: ✭ 97 (-11.82%)
Mutual labels:  api, microservices

flare

Build Status Coveralls GoDoc

Flare is a service that listen to changes on HTTP endpoints and notify subscripted clients about the changes. It help reduce the pressure on APIs by avoiding the clients to do pooling requests to search for new/changed content and the need of the APIs to develop workers to notify the clients about the.

There is no need to the the service know anything about who is consuming it's updates, this is abstracted and lead to a simpler design on APIs. Problems like scaling the workers to notify the changes if the number of subscriptions increase, need to control the delivery success of the messages, include/update/delete the clients on your subscription list and so on are just solved with Flare.

How to run

go get github.com/diegobernardes/flare
cd $GOPATH/src/github.com/diegobernardes/flare/service/flare/cmd
go run flare.go start

There is a example at misc/example, it's a docker-compose that starts a Flare server, a producer and a consumer. From times to times the producer create/update/delete a given document and the consumer receives this changes from Flare. You must have docker-compose and docker to run this example.

go get github.com/diegobernardes/flare
cd $GOPATH/src/github.com/diegobernardes/flare/misc/example
make run

There is also a Docker image:

docker run --rm -p 8080:8080 diegobernardes/flare:v0.1.0-alpha

How it works

Flare has 3 basic entities: Resource, Subscription and Document. The origin of content is responsible for Resource and Document entities and the clients are responsible for Subscription.

Resource

Resource represents the entity you want to track. It cannot be updated, only deleted, and to delete, first you need to remove all the associated subscriptions.

Field Description
endpoint Is the actual document that gonna be tracked. wildcards are required to track the collection and they can be later used at subscriptions.
change.field The field that is used to track changes on a document. It can be a string containing a date or a auto incremented integer.
change.format If the field is a date, this fields has the format to parse the document date. More info about the format here.

Endpoint: POST http://flare.com/resources

{
	"endpoint": "http://api.company.com/users/{id}",
	"change": {
		"field": "updatedAt",
		"format": "2006-01-02T15:04:05Z07:00"
	}
}

Subscription

Subscription is the responsible to notify the clients when a document from a resource changes.

Field Description
endpoint.url The address of the client that gonna receive the notification.
endpoint.method The method used on the notification request.
endpoint.headers A list of headers to sent within the request.
endpoint.actions.(create,update,delete).(url,method,headers) Override of attributes per action.
delivery.success List of success status code. This is used to mark the notification as delivered for the respective client.
delivery.discard List of status code to discard the notification.
content.document Send the document.
content.envelope Send the document, if marked, inside a envelope with some metadata.
data Can only be set if content.envelope is true. Can be used to provide aditional information to the client that gonna receive the notification. It also can interpolate wildcards used at resource endpoint definition.

Endpoint: POST http://flare.com/resources/:resource-id/subscriptions

{
	"endpoint": {
		"url": "http://api.company.com/wishlist/{id}",
		"method": "post",
		"headers": {
			"Authorization": [
				"Basic YWxhZGRpbjpvcGVuc2VzYW1l"
			]
		},
		"actions": {
			"delete": {
				"method": "delete"
			}
		}
	},
	"delivery": {
		"success": [200],
		"discard": [500]
	},
	"content": {
		"envelope": true,
		"document": true
	},
	"data": {
		"service": "user",
		"id": "{id}"
	}
}

Document

To update a document, a PUT should be done at http://flare.com/documents/{endpoint}, where the {endpoint} is the real document endpoint and it should match the information inserted at the resource creation. The body should contain the document. If the origin send the same document or older documents more then one time, the service don't gonna notify the clients again because it know the document version each client has. The notification only happens when is really needed.

The delete should be sent with the delete method and no body.

Roadmap

I have a lot of ideas and plans for Flare, but, what i've planned to the stable release (v1.0.0) is this:

  • Selective subscriptions
    During the subscription would be nice to filter the messages like this: message.quantity > 0.

  • Retry policy
    Control how many times the message should try to deliver.

  • Queue isolation
    Isolate the queues. Today all the queues are shared and this disable other features like rate limit and backpressure.

  • Rate limit
    Control the concurrency to send the updates.

  • Backpressure
    Allow the subscriptions to stay at passive mode and only receive updates when ask.

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].