Questions tagged [octopus]

Octopus is a framework for database sharding with Ruby on Rails' ActiveRecord.

From the README:

Octopus is a better way to do Database Sharding in ActiveRecord. Sharding allows multiple databases in the same rails application. While there are several projects that implement Sharding (e.g. DbCharmer, DataFabric, MultiDb), each project has its own limitations. The main goal of octopus project is to provide a better way of doing Database Sharding.

Octopus supports:

  • Sharding (with multiple shards, and grouped shards).
  • Replication (Master/slave support, with multiple slaves).
  • Moving data between shards with migrations.

Source code for Octopus is on github.

143 questions
11
votes
1 answer

How to do rails db:migrate on multiple shards that are not master slave relationship at once on rails?

I have an app which which uses different database based on the subdomain. So essentially, the schema would be the same, but the data would differ for each databases. But when I release some new features and it would require some schema changes, I…
Suthan Bala
  • 3,209
  • 5
  • 34
  • 59
9
votes
2 answers

Rails: How to split write/read query across master/slave database

My website has a very heavy read traffic. A lot heavier than write traffic. To improve the performance of my website I have thought of going with master/slave database configuration. The octupus gem seems to provide what I want, but since my app is…
8
votes
1 answer

Why does my .tar file produces hundreds of PaxHeader files?

I am setting up an AutoCI -> Jenkins -> Octopus automated build process. I use a package called octopackjs & gulp-octo to pack my node.js project up into a .tar file like so: return gulp.src(['**/*', '!gulpfile.js']) …
Pietro Gobbato
  • 378
  • 2
  • 9
7
votes
6 answers

Rails ActiveRecord: Getting the id of a raw insert

sql = DmozCategory.send(:sanitize_sql_array, ["INSERT INTO dmoz_categories (id, dmoz_category_title, dmoz_category_name, dmoz_category_description, created_at, updated_at, dmoz_category_lastupdate) VALUES (?, ?, ?, ?, NOW(), NOW(), ?)",…
Ben G
  • 26,091
  • 34
  • 103
  • 170
6
votes
1 answer

Rails Octopus Gem - Master-Slave Replication connection behaviour when slave is down

I'm testing this great gem Octopus with Rails 4.0.2 in development. I created a Slave db and configured octopus as follows (config>shards.yml): octopus: environments: - development replicated: true fully_replicated: true …
5
votes
0 answers

Database_Cleaner with AR-Octopus not cleaning records

We have a project that is using the AR-Octopus gem using sharded databases. The problem we are running into is that the gem 'database_cleaner' is not cleaning records when using this setup, as we are consistently having leftover records in our test…
William Holt
  • 549
  • 4
  • 14
5
votes
2 answers

Rails with Octopus gem. How to create db's defined in shards.yml with rake

I need to configure my app to use multiple shards, and even multiple db adapters. I have noticed that all rake commands like rake db:migrate are working, and have consequence on shards defined in shards.yml, except rake db:create. It will be a real…
Andrey Yasinishyn
  • 1,851
  • 2
  • 23
  • 36
4
votes
1 answer

Octopus deployment not picking up a process change

I encountered an error in one of our deployments today so i applied a fix to one of the processes and tried again, however the fix was not picked up. I found i had to create a new release. Is there anyway to force octopus to pick up a change if…
Richard Banks
  • 2,946
  • 5
  • 34
  • 71
4
votes
2 answers

Octopus deployment caching

We are using octopus to deploy our project. A bunch of steps which gets executed during the deployment. One of them is a powershell script and that powershell script is a work in progress. However to test the script we have to perform a dummy check…
Immortal
  • 1,233
  • 4
  • 20
  • 47
3
votes
4 answers

Error in deployment in Octopus deploy

Hi I am new to Octopus deploy. I have created a nupkg and trying to deploy it to an IIS server. I am getting following error. There was a problem with your request. There must be at least one enabled healthy machine to deploy to in the…
user2746466
  • 361
  • 5
  • 23
3
votes
1 answer

Is there any way i can read TeamCity user defined parameter values using PowerShell script

Is there any way i can read TeamCity user defined parameter values using PowerShell script. Following is what I'm trying to do. I have already created following parameters in the TeamCity build configuration Variable Name Variable…
mahesh
  • 468
  • 2
  • 8
  • 25
3
votes
1 answer

Performing a transaction with Rails ar-octopus gem

I couldn't find in ar-octopus (https://github.com/tchandy/octopus) documentation, how can i perform a transaction. When performing : ActiveRecord::Base.connection.transaction do Octopus.using(:shard, &block) end the code in the block isn't…
nitzan
  • 319
  • 1
  • 14
3
votes
0 answers

octopus gem trying to write to slave instead of master

The following error is being generated on a slave server for a rails 3.2.18 application running gem "ar-octopus" over postgreSQL 9.3.5 ActiveRecord::StatementInvalid in Devise::SessionsController#create PG::ReadOnlySqlTransaction: ERROR: cannot…
Jerome
  • 5,583
  • 3
  • 33
  • 76
3
votes
1 answer

git octopus merge 'silently' not merging some branches

I am having some unexpected results that seem to be based on the ordering of branches given to git merge when performing an octopus merge. The following script will replicate my situation #!/usr/bin/env bash rm -rf TEMP # create area to work…
cjh
  • 1,113
  • 1
  • 9
  • 21
3
votes
1 answer

Unicorn does not sever database connections properly after new deploy

I am currently having a problem with database connections after a Capistrano deploy. On the database server it seems like unicorn does not sever the previous connections and it just keeps adding on top of the old ones. I am doing a preload true, and…
nvd
  • 322
  • 3
  • 9
1
2 3
9 10