Elassandro is a basic databases synchronizer, that guarantees data synchronization between Cassandra and Elasticsearch.
Cassandra is considered as a primary data storage. Every inserted row in Cassandra will has its own respective document stored in Elasticsearch. Following the same logic, each update or delete method invoked on Cassandra, will systematically be invoked on Elasticsearch.
This API is built over Cassandra 3.0.9 and Elasticsearch 5.4.1.
Before running this API, you can create a keyspace using this command :
CREATE KEYSPACE your_keyspace_name;
USE your_keyspace_name;
After that, you can create your table ; Example :
CREATE TABLE city(
name text,
prefecture text,
country text,
population bigint,
PRIMARY KEY (name, prefecture)
);
At this point, you can create the respective Elasticsearch index for your Cassandra Table, with this command :
PUT cities
{
"mappings": {
"city": {
"properties": {
"name": {
"type": "text"
},
"prefecture": {
"type": "text"
},
"country": {
"type": "text"
},
"population": {
"type": "long"
}
}
}
}
}
curl -XPUT "http://localhost:9200/cities" -H 'Content-Type: application/json' -d'
{
"mappings": {
"city": {
"properties": {
"name": {
"type": "text"
},
"prefecture": {
"type": "text"
},
"country": {
"type": "text"
},
"population": {
"type": "long"
}
}
}
}
}'
The work on this branch is not completed ... You may take a look at the basic synchronizer (complete) : https://github.com/ghazi-naceur/elassandro-dbs-synchronizer/tree/elassandro-basic-synchronizer .
The aim of this branch (advanced synchronizer/master branch) is to integrate Apache Camel and ActiveMQ in order to provide an Asynchronous CRUD in distinct routes.
In order to provide a synchronization between Cassandra and Elasticsearch, I recommend using Cassandra Trigger :
https://github.com/ghazi-naceur/cassandra-trigger (forked from gardeup)