{"id":44103156,"url":"https://github.com/conradwt/cassandra-example-using-ruby","last_synced_at":"2026-02-08T14:37:42.027Z","repository":{"id":20970013,"uuid":"24258903","full_name":"conradwt/cassandra-example-using-ruby","owner":"conradwt","description":"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.","archived":false,"fork":false,"pushed_at":"2023-09-25T01:56:19.000Z","size":364,"stargazers_count":23,"open_issues_count":0,"forks_count":14,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T21:54:38.617Z","etag":null,"topics":["cassandra","hacktoberfest","ruby","ruby-on-rails","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/conradwt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-20T09:28:42.000Z","updated_at":"2023-05-07T17:39:08.000Z","dependencies_parsed_at":"2023-02-11T22:01:10.909Z","dependency_job_id":null,"html_url":"https://github.com/conradwt/cassandra-example-using-ruby","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/conradwt/cassandra-example-using-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conradwt%2Fcassandra-example-using-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conradwt%2Fcassandra-example-using-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conradwt%2Fcassandra-example-using-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conradwt%2Fcassandra-example-using-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conradwt","download_url":"https://codeload.github.com/conradwt/cassandra-example-using-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conradwt%2Fcassandra-example-using-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29233476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T14:18:14.570Z","status":"ssl_error","status_checked_at":"2026-02-08T14:18:14.071Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cassandra","hacktoberfest","ruby","ruby-on-rails","tutorial"],"created_at":"2026-02-08T14:37:41.584Z","updated_at":"2026-02-08T14:37:42.017Z","avatar_url":"https://github.com/conradwt.png","language":"Ruby","readme":"# Cassandra Example Using Ruby\n\nThe 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.\n\n## Requirements\n\n- [Docker Desktop](https://www.docker.com/products/docker-desktop) 4.23.0 or newer\n\n- Rails \u003e= 5.2.8.1 and \u003c 6\n\n- Ruby \u003e= 2.7.8 and \u003c 3\n\nNote: This tutorial was updated on macOS 13.5.2.\n\n## Communication\n\n- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/cassandra). (Tag 'cassandra')\n- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/cassandra).\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Installation, Setup, and Usage\n\n1.  Open new terminal window\n\n2.  Create the project directory\n\n    ```zsh\n    mkdir blog\n    cd blog\n    ```\n\n3.  Create `docker-compose.yml` file with the following content:\n\n    ```yaml\n    services:\n      some-cassandra:\n        image: cassandra:4.1.3\n        container_name: some-cassandra\n        environment:\n          - CASSANDRA_CLUSTER_NAME=cassandra-cluster\n        ports:\n          - 9042:9042\n        volumes:\n          - cassandra-data:/var/lib/cassandra\n\n    volumes:\n      cassandra-data: {}\n    ```\n\n4.  Start a single node cluster\n\n    ```zsh\n    docker-compose up -d\n    ```\n\n5.  Check the status of your cluster\n\n    ```zsh\n    docker-compose exec some-cassandra nodetool status\n    ```\n\n    Note: One should see that the node status as Up Normal (UN) that looks similar to the following:\n\n    ```text\n    Datacenter: datacenter1\n    =======================\n    Status=Up/Down\n    |/ State=Normal/Leaving/Joining/Moving\n    --  Address     Load       Tokens       Owns    Host ID                               Rack\n    UN  172.19.0.2  582.5 KB   256          ?       e61cf276-c860-4990-bf03-37161414aed2  rack1\n\n    Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless\n    ```\n\n6.  Generate a new Rails application\n\n    ```zsh\n    gem install rails -v '5.2.8.1'\n    rails _5.2.8.1_ new . ---skip-active-record --skip-active-storage -T --skip-bundle --skip-webpack-install --skip-javascript --no-rc\n    ```\n\n7.  Add the Ruby cequel gem\n\n    ```zsh\n    bundle add i18n --version \"= 1.8.11\"\n    bundle add cequel\n    bundle add activemodel-serializers-xml\n    ```\n\n8.  Generate scaffold of the application\n\n    ```zsh\n    rails g scaffold post title body\n    ```\n\n9.  Add the following as the first route within config/routes.rb file:\n\n    ```ruby\n    root 'posts#index'\n    ```\n\n10. Create app/models/post.rb file with the following content:\n\n    ```ruby\n    class Post\n      include Cequel::Record\n\n      key :id, :timeuuid, auto: true\n      column :title, :text\n      column :body, :text\n\n      timestamps\n    end\n    ```\n\n11. Create a default Cassandra configuration file\n\n    ```zsh\n    rails g cequel:configuration\n    ```\n\n12. Initialize Cassandra keyspace (database)\n\n    ```zsh\n    rails cequel:keyspace:create\n    ```\n\n13. Synchronize your Rails model schemas with Cassandra keyspace\n\n    ```zsh\n    rails cequel:migrate\n    ```\n\n14. Start the Rails server\n\n    ```zsh\n    rails s\n    ```\n\n15. Play with the application\n\n    ```zsh\n    open http://localhost:3000\n    ```\n\n16. Remove the keyspace\n\n    ```zsh\n    rails cequel:keyspace:drop\n    ```\n\n17. Stop a single node cluster\n\n    ```zsh\n    docker-compose down\n    ```\n\n---\n\n## References\n\n- [Apache Cassandra](http://cassandra.apache.org)\n\n- [Cequel](https://github.com/cequel/cequel)\n\n## Support\n\nBug reports and feature requests can be filed for the cassandra-example-using-rails project here:\n\n- [File Bug Reports and Features](https://github.com/conradwt/cassandra-example-using-ruby/issues)\n\n## Contact\n\nFollow Conrad Taylor on Twitter ([@conradwt](https://twitter.com/conradwt))\n\n## Creator\n\n- [Conrad Taylor](http://github.com/conradwt) ([@conradwt](https://twitter.com/conradwt))\n\n## License\n\nThis repository is released under the [MIT License](./LICENSE.md).\n\n## Copyright\n\n\u0026copy; Copyright 2014 - 2023 Conrad Taylor. All Rights Reserved.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconradwt%2Fcassandra-example-using-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconradwt%2Fcassandra-example-using-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconradwt%2Fcassandra-example-using-ruby/lists"}