{"id":22282583,"url":"https://github.com/carbonfive/active_column","last_synced_at":"2025-07-10T01:35:08.331Z","repository":{"id":552651,"uuid":"1137014","full_name":"carbonfive/active_column","owner":"carbonfive","description":"ActiveColumn is a data management framework for Cassandra.  It includes data migrations similar to ActiveRecord, and a data mapping framework for \"time line\" modeled data.","archived":false,"fork":false,"pushed_at":"2024-03-01T16:48:25.000Z","size":147,"stargazers_count":53,"open_issues_count":12,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T03:54:24.640Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://blog.carbonfive.com/2011/01/06/database-migrations-for-cassandra-with-activecolumn/","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/carbonfive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-04T01:52:26.000Z","updated_at":"2024-10-13T20:27:15.000Z","dependencies_parsed_at":"2024-12-03T21:15:10.426Z","dependency_job_id":null,"html_url":"https://github.com/carbonfive/active_column","commit_stats":{"total_commits":97,"total_committers":7,"mean_commits":"13.857142857142858","dds":"0.22680412371134018","last_synced_commit":"644b2e9bdfa7eb45934425e89f66aedb1601b873"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbonfive%2Factive_column","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbonfive%2Factive_column/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbonfive%2Factive_column/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbonfive%2Factive_column/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carbonfive","download_url":"https://codeload.github.com/carbonfive/active_column/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154999,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-03T16:33:41.214Z","updated_at":"2025-04-10T03:54:29.860Z","avatar_url":"https://github.com/carbonfive.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"**IMPORTANT**: If you are reading this on the main ActiveColumn page on github, please go to\n[the actual README page](./active_column/blob/master/README.md) so that links bring you to the right place.\n\n# ActiveColumn\n\nActiveColumn is a framework for working with data in Cassandra.  It currently includes two features:\n\n- Database migrations\n- \"Time line\" model data management\n\nData migrations are very similar to those in ActiveRecord, and are documented in [Migrate](./docs/Migrate.md).\n\nTime line data management is loosely based on concepts in ActiveRecord, but is adapted to saving data in which rows in\nCassandra grow indefinitely over time, such as in the oft-used Twitter example for Cassandra.  This usage is documented\nin:\n\n- [Create](./docs/Create.md) - how to create data\n- [Query](./docs/Query.md) - how to find data\n\n## Installation\n\nAdd ActiveColumn to your Gemfile:\n\u003cpre\u003e\ngem 'active_column'\n\u003c/pre\u003e\n\nInstall with bundler:\n\u003cpre\u003e\nbundle install\n\u003c/pre\u003e\n\n## Usage\n\n### Configuration\n\nActiveColumn requires Cassandra 0.7 or above, as well as the [cassandra gem](https://github.com/twitter/cassandra),\nversion 0.9 or above.  You must also be sure to use the Cassandra 0.7 support in the gem, which can be done by\nadding Cassandra to your Gemfile like this:\n\u003cpre\u003e\ngem 'cassandra', '\u003e= 0.9', :require =\u003e 'cassandra/0.7'\n\u003c/pre\u003e\n\nData migrations in ActiveColumn are used within a Rails project, and are driven off of a configuration file,\nconfig/cassandra.yml.  It should look something like this:\n\n_config/cassandra.yml_\n\u003cpre\u003e\ntest:\n  servers: \"127.0.0.1:9160\"\n  keyspace: \"myapp_test\"\n  thrift:\n    timeout: 3\n    retries: 2\n\ndevelopment:\n  servers: \"127.0.0.1:9160\"\n  keyspace: \"myapp_development\"\n  thrift:\n    timeout: 3\n    retries: 2\n\u003c/pre\u003e\n\nYou can use embedded ruby code in the YAML file to determine host/machine specific settings.\n\n\u003cpre\u003e\n  production:\n    servers: \"\u0026lt;%=get_from_file('abc.conf')%\u0026gt;:9160\"\n    keyspace: \"\u0026lt;%=get_from_file('abc.conf')%\u0026gt;\"\n    disable_node_auto_discovery: true\n    thrift:\n      timeout: 3\n      retries: 2\n\u003c/pre\u003e\n\nNode Auto Discovery\n\nYou can set disable_node_auto_discovery to off by setting disable_node_auto_discovery flag in your cassandra.yml\n\nIn order to get time line modeling support, you must provide ActiveColumn with an instance of a Cassandra object.\nSince you have your cassandra.yml from above, you can do this very simply like this:\n\n\n_config/initializers/cassandra.rb_\n\u003cpre\u003e\nconfig = YAML.load_file(Rails.root.join(\"config\", \"cassandra.yml\"))[Rails.env]\n$cassandra = Cassandra.new(config['keyspace'],\n                           config['servers'],\n                           config['thrift'])\n\nActiveColumn.connection = $cassandra\n\u003c/pre\u003e\n\nAs you can see, I create a global $cassandra variable, which I use in my tests to validate data directly in Cassandra.\n\n### Examples\n\nAdd column family\n\u003cpre\u003e\n  create_column_family :impressions do |cf|\n    cf.comment = 'impressions for something'\n    cf.comparator_type = :utf8 \n    cf.key_validation_class = :utf8 \n  end\n\u003c/pre\u003e\n\nDrop column family\n\u003cpre\u003e\n  drop_column_family :impressions\n\u003c/pre\u003e\n\nRename column family\n\u003cpre\u003e\n  rename_column_family :impressions, :showings\n\u003c/pre\u003e\n\nUpdate column family\n\u003cpre\u003e\n  update_column_family :impressions do |cf|\n    cf.comment = \"blah\"\n    cf.gc_grace_seconds = 3600\n  end\n\u003c/pre\u003e\n\nOne other thing to note is that you obviously must have Cassandra installed and running!  Please take a look at the\n[mama_cass gem](https://github.com/carbonfive/mama_cass) for a quick way to get up and running with Cassandra for\ndevelopment and testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbonfive%2Factive_column","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarbonfive%2Factive_column","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbonfive%2Factive_column/lists"}