Skip to content

Commit

Permalink
update readme to include information on the NATS plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jmealo committed Oct 7, 2015
1 parent 4e1ff27 commit 5aaa3cc
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,88 @@
[![Build Status](https://travis-ci.org/JarvusInnovations/lapidus.svg)](https://travis-ci.org/JarvusInnovations/lapidus)
[![Coverage Status](https://coveralls.io/repos/JarvusInnovations/lapidus/badge.svg?branch=master&service=github)](https://coveralls.io/github/JarvusInnovations/lapidus?branch=master)

# Configuration
Currently MySQL and PostgreSQL databases are supported with MongoDB and Redis support on the way.

## PostgreSQL
You'll need PostgreSQL 9.4 or higher with logical replication and install the decoding_json plugin. Forks of PostgreSQL
should be compatible provided they ship with pg_recvlogical.
```shell
# TODO: How to setup PostgreSQL
```

## MySQL
You'll need MySQL 5.1.15 or higher with binary logging configured. Forks of MySQL should be compatible but have not been
tested.
```shell
# TODO: How to setup MySQL
```

# Plugins
## NATS
Lapidus ships with a lightweight NATS plugin. NATS is an open-source, high-performance, lightweight cloud native
messaging system.

###Configuration

***Publish to NATS for all backends (one connection per backend):***
```javascript
{
"backends": [...]
],
"plugins": {
"nats": {
"server": "nats://localhost:4222"
}
}
}
```

***Publish to NATS for a specific backend:***
```javascript
{
"backends": [
{
"type": "postgresql",
"host": "the.hatch",
"user": "desmond",
"database": "darma",
"password": "notpennysboat123",
"slot": "walts_raft",

"plugins": {
"nats": {
"server": "nats://localhost:4222"
}
}
}
]
}

### Events
Insert, Update and Delete events will be published using the subject ``schema.table.pk``. Here are examples events:

**Insert:**
```javascript
// TODO: sample insert
```

**Update:**
```javascript
// TODO: sample update
```

**Delete:**
```javascript
// TODO: sample delete
```

### Caveats

* At this time, transactions and other event types are not published to NATS.
* Each worker uses its own connection to NATS using non-blocking event emitters; out of order delivery is likely.
* NATS does not guarantee in order delivery so a blocking variant is not likely (it's 10-20 LoC if you're interested).

# License
Lapidus is MIT licensed. The artwork in the header is Copyright [Matt Greenholt](http://mattgreenholt.blogspot.com/).

Expand Down

0 comments on commit 5aaa3cc

Please sign in to comment.