All Projects → iamthiago → cassandra-phantom

iamthiago / cassandra-phantom

Licence: other
Cassandra + Phantom Example

Programming Languages

scala
5932 projects
Makefile
30231 projects

Projects that are alternatives of or similar to cassandra-phantom

ecchronos
Ericsson distributed repair scheduler for Apache Cassandra
Stars: ✭ 22 (-65.62%)
Mutual labels:  cassandra
Troilus
Troilus is a Java client library for Cassandra.
Stars: ✭ 17 (-73.44%)
Mutual labels:  cassandra
akka-http-docker-sample
example of running an Sbt application in Docker based on openjdk:jre-alpine
Stars: ✭ 20 (-68.75%)
Mutual labels:  sbt
sbt-babel
An SBT plugin to perform Babel compilation.
Stars: ✭ 12 (-81.25%)
Mutual labels:  sbt
outwatch
The Functional and Reactive Web-Frontend Library for Scala.js
Stars: ✭ 444 (+593.75%)
Mutual labels:  sbt
sliding-puzzle
Sliding puzzle game implemented in Scala / Scala.js / JavaFX
Stars: ✭ 25 (-60.94%)
Mutual labels:  sbt
Morphl Community Edition
MorphL Community Edition uses big data and machine learning to predict user behaviors in digital products and services with the end goal of increasing KPIs (click-through rates, conversion rates, etc.) through personalization
Stars: ✭ 253 (+295.31%)
Mutual labels:  cassandra
scalarr
A command-line client for Sonarr, written in Scala
Stars: ✭ 33 (-48.44%)
Mutual labels:  sbt
sbt-sass
A fork of the sbt-sass repository which seems to be abandoned.
Stars: ✭ 32 (-50%)
Mutual labels:  sbt
Converter
Typescript to Scala.js converter
Stars: ✭ 168 (+162.5%)
Mutual labels:  sbt
sbt-sonar
An sbt plugin which provides an easy way to integrate Scala projects with SonarQube.
Stars: ✭ 62 (-3.12%)
Mutual labels:  sbt
sbt-avro
Plugin SBT to Generate Scala classes from Apache Avro schemas hosted on a remote Confluent Schema Registry.
Stars: ✭ 15 (-76.56%)
Mutual labels:  sbt
cassandra-prometheus
prometheus exporter for cassandra
Stars: ✭ 25 (-60.94%)
Mutual labels:  cassandra
pyspark-cassandra
pyspark-cassandra is a Python port of the awesome @datastax Spark Cassandra connector. Compatible w/ Spark 2.0, 2.1, 2.2, 2.3 and 2.4
Stars: ✭ 70 (+9.38%)
Mutual labels:  cassandra
cassandra-data-apis
Data APIs for Apache Cassandra
Stars: ✭ 18 (-71.87%)
Mutual labels:  cassandra
sbt-ghpages
git, site and ghpages support for sbt projects.
Stars: ✭ 94 (+46.88%)
Mutual labels:  sbt
janusgraph-docker
Yet another JanusGraph, Cassandra/Scylla and Elasticsearch in Docker Compose setup
Stars: ✭ 54 (-15.62%)
Mutual labels:  cassandra
weui-scalajs
write WeApp with scalajs
Stars: ✭ 18 (-71.87%)
Mutual labels:  sbt
sbt-graphql
SBT plugin to generate and validate graphql schemas written with Sangria
Stars: ✭ 94 (+46.88%)
Mutual labels:  sbt
ecaudit
Ericsson Audit plug-in for Apache Cassandra
Stars: ✭ 36 (-43.75%)
Mutual labels:  cassandra

Phantom DSL Example

Build Status

This project will give you the idea on how to design your cassandra tables in scala using the phantom-dsl. My inspiration is to bring here a more real world example based on this library.

Connect to a secure Cassandra Cluster

In the class Connector you will find a connector that connects to a Cassandra Cluster

Set Consistency Level

Phantom-DSL offers to you an easy way to set the consistency level for any query you want to execute. You can set that for each query. You can see an example of it in the following classes: SongsModel and SongsByArtistModel. You will find this piece of code .consistencyLevel_=(ConsistencyLevel.ONE) where you can change it to whatever you want, accordingly to your needs.

Handle queries for multiple tables

This is maybe the main goal of this project, showing to you how to handle multiple versions of the same table. Here we have:

  • Songs
  • SongsByArtist

You will find how to insert and delete on both tables.

Requirements

This project uses docker in order to get up and running a cassandra instance.

Testing

We are using the official cassandra docker image to setup a simple host.

For convenience we are using Makefile where you will find the following commands:

- make cassandra/run
    This command starts a cassandra instance in your localhost and name it as cassandra-phantom.
    You can see it using the `docker ps` command.
    
- make cassandra/clean 
    It removes the existing image from your docker.
    
- make cassandra 
    Runs both command in sequence.

If you don't know Makefile, please check the links below on the Resources section.

After that you can test using sbt test.

Resources

Thanks

Special thanks to Flavian who have helped me to find out the best way to use phantom to model our Cassandra tables.

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