All Projects → conradwt → cassandra-example-using-ruby

conradwt / cassandra-example-using-ruby

Licence: MIT license
The purpose of this step-by-step tutorial is to provide a very simple example of configuring and using the Cassandra database engine with the Ruby Language.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
CSS
56736 projects

Projects that are alternatives of or similar to cassandra-example-using-ruby

railways
A plugin for RubyMine and IntelliJ IDEA Ultimate that adds a panel with routes of Ruby on Rails application.
Stars: ✭ 44 (+109.52%)
Mutual labels:  ruby-on-rails
spring-data-starter
⚡️ A sample Spring Data Cassandra REST API
Stars: ✭ 36 (+71.43%)
Mutual labels:  cassandra
request store-sidekiq
Provides an easy integration between RequestStore and Sidekiq
Stars: ✭ 32 (+52.38%)
Mutual labels:  ruby-on-rails
graphql-ruby-sample
Sample application for demonstrating GraphQL Ruby on Rails integration
Stars: ✭ 16 (-23.81%)
Mutual labels:  ruby-on-rails
campaign-manager
The Camapign Management UI for RTB4Free, the open source bidder / DSP.
Stars: ✭ 24 (+14.29%)
Mutual labels:  ruby-on-rails
vscode-cql
CQL language support for VS Code.
Stars: ✭ 15 (-28.57%)
Mutual labels:  cassandra
MyopicVicar
MyopicVicar (short-sighted clergyman!) is an open-source genealogy record database and search engine. It powers the FreeREG database of parish registers, the FreeCEN database of census records, the next version of FreeBMD database of Civil Registration indexes and other Genealogical applications.
Stars: ✭ 40 (+90.48%)
Mutual labels:  ruby-on-rails
awesome-programming-tutorials
📚 Collect all awesome programming tutorials
Stars: ✭ 39 (+85.71%)
Mutual labels:  ruby-on-rails
shog
Simple colored logging for rails 4 and 5 apps
Stars: ✭ 69 (+228.57%)
Mutual labels:  ruby-on-rails
nxt state machine
A simple but powerful state machine implementation.
Stars: ✭ 14 (-33.33%)
Mutual labels:  ruby-on-rails
stimulus reflex todomvc
An implementation of TodoMVC using Ruby on Rails, StimulusJS, and StimulusReflex
Stars: ✭ 50 (+138.1%)
Mutual labels:  ruby-on-rails
cassandra-diagnostics
Cassandra Node Diagnostics Tools
Stars: ✭ 51 (+142.86%)
Mutual labels:  cassandra
activerecord-setops
Union, Intersect, and Difference set operations for ActiveRecord (also, SQL's UnionAll).
Stars: ✭ 21 (+0%)
Mutual labels:  ruby-on-rails
prefixed ids
Friendly Prefixed IDs for your Ruby on Rails models
Stars: ✭ 159 (+657.14%)
Mutual labels:  ruby-on-rails
mapbox-gl-rails
A gem to provide Mapbox GL JS and it's ecosystem (plugins) for Rails applications 🚆
Stars: ✭ 32 (+52.38%)
Mutual labels:  ruby-on-rails
i18n lazy scope
Use lazy lookup with custom i18n scopes.
Stars: ✭ 11 (-47.62%)
Mutual labels:  ruby-on-rails
guardrails
guardrails.cs.virginia.edu
Stars: ✭ 18 (-14.29%)
Mutual labels:  ruby-on-rails
freestyle-cassandra
Freestyle Cassandra
Stars: ✭ 17 (-19.05%)
Mutual labels:  cassandra
twitter-go
A high throughput, horizontally scalable microservice backend using Go, Cassandra, RabbitMQ, Kubernetes, Helm.
Stars: ✭ 39 (+85.71%)
Mutual labels:  cassandra
lookbook
A tool to help browse, develop, test & document ViewComponents in Ruby on Rails apps 🛠
Stars: ✭ 420 (+1900%)
Mutual labels:  ruby-on-rails

Cassandra Example Using Ruby

The purpose of this step by step tutorial is to provide a very simple example of configuring and using Cassandra database engine with the Ruby Language.

Requirements

  • Cassandra 4.0.1 or newer

  • OpenJDK >= 11.0.11 and < 12

  • Node 14.18.2 or newer

  • Rails 6.1.6 or newer

  • Ruby 3.1.2 or newer

  • Yarn 1.22.18 or newer

Note: This tutorial was updated on macOS 12.3.1.

Communication

  • If you need help, use Stack Overflow. (Tag 'cassandra')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation, Setup, and Usage

  1. Open new terminal window

  2. Download Cassandra

    cd
    wget https://downloads.apache.org/cassandra/4.0.1/apache-cassandra-4.0.1-bin.tar.gz
  3. Installing Cassandra

    cd
    gzip -dc apache-cassandra-4.0.1-bin.tar.gz | tar xf -
  4. In the terminal, perform the following:

    export CASSANDRA_VERSION=4.0.1
    export CASSANDRA_HOME=${HOME}/apache-cassandra-${CASSANDRA_VERSION}
    export PATH=${CASSANDRA_HOME}/bin:${PATH}
  5. Start Cassandra

    cassandra -f
  6. Open another terminal window

  7. Generate a new Rails application

    rails new blog ---skip-active-record --skip-active-storage -T --skip-bundle --skip-webpack-install --skip-javascript
  8. Add Ruby gems

    cd blog
    bundle add cequel
    bundle add activemodel-serializers-xml
    bundle add sorted_set
  9. Generate scaffold of the application

    rails g scaffold post title body
  10. Add the following as the first route within config/routes.rb file:

    root 'posts#index'
  11. Create app/models/post.rb file with the following content:

    class Post
      include Cequel::Record
    
      key :id, :timeuuid, auto: true
      column :title, :text
      column :body, :text
    
      timestamps
    end
  12. Create a default Cassandra configuration file

    rails g cequel:configuration
  13. Initialize Cassandra keyspace (database)

    rails cequel:keyspace:create
  14. Synchronize your Rails model schemas with Cassandra keyspace

    rails cequel:migrate
  15. Start the Rails server

    rails s
  16. Play with the application

    open http://localhost:3000

References

Support

Bug reports and feature requests can be filed for the cassandra-example-using-rails project here:

Contact

Follow Conrad Taylor on Twitter (@conradwt)

Creator

License

This repository is released under the MIT License.

Copyright

© Copyright 2014 - 2021 Conrad Taylor. All Rights Reserved.

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