cote

A Node.js library for building zero-configuration microservices.

README

cote

cote — A Node.js library for building zero-configuration microservices

cote lets you write zero-configuration microservices in Node.js without nginx,
haproxy, redis, rabbitmq or _anything else_. It is batteries — and chargers! —
included.

Join us on
cote Slack
for anything related to cote.

Features

- Zero dependency: Microservices with only JavaScript and Node.js
- Zero-configuration: No IP addresses, no ports, no routing to configure
- Decentralized: No fixed parts, no "manager" nodes, no single point of
                     failure
- Auto-discovery: Services discover each other without a central bookkeeper
- Fault-tolerant: Don't lose any requests when a service is down
- Scalable: Horizontally scale to any number of machines
- Performant: Process thousands of messages per second
- Humanized API: Extremely simple to get started with a reasonable API!

Develop your first microservices in under two minutes:
in time-service.js...
  1. ```js
  2. const cote = require('cote');
  3. const timeService = new cote.Responder({ name: 'Time Service' });

  4. timeService.on('time', (req, cb) => {
  5.     cb(new Date());
  6. });
  7. ```

in client.js...
  1. ```js
  2. const cote = require('cote');
  3. const client = new cote.Requester({ name: 'Client' });

  4. client.send({ type: 'time' }, (time) => {
  5.     console.log(time);
  6. });
  7. ```

You can run these files anyway you like — on a single machine or scaled out to
hundreds of machines in different datacenters — and they will just work. No
configuration, no third party components, no nginx, no kafka, no consul and
only Node.js. cote is batteries — and chargers — included!

Microservices case study
Make sure to check out
implements a complete e-commerce application with microservices using
cote. It features;

+ a back-office with real-time updates for managing the catalogue of products
and displaying sales with a RESTful API (express.js)
+ a storefront for end-users with real-time updates to products where they
can buy the products with WebSockets (socket.io)
+ a user microservice for user CRUD
+ a product microservice for product CRUD
+ a purchase microservice that enables users to buy products
+ a payment microservice that deals with money transactions that occur as
a result of purchases
+ Docker compose configuration for running the system locally

cote plays very well with Docker, taking advantage of its network overlay
features. The case study implements a scalable microservices application
via Docker and can scale to multiple machines.