0

The Ruby on Rails project I've just started on will need to use MS SQL Server at some deployments, and PostgreSQL at other deployments. It won't be connecting to SQL Server and PGSQL at the same time: just one or the other depending on the deploy location. I'm new to Rails and SQL Server, so I'm not sure if this is doable/feasible? I'm thinking Rails' ActiveRecord layer (along with the pg and activerecord-sqlserver-adapter gems) should abstract away which RDBMS system I am using, so that it should just work, but I'm sure there are scenarios that I haven't thought of yet. Does anyone have any experience with this kind of deployment-dependent DB setup (or just know more about RoR/RDBMS) and can give me some advice?

spcurry
  • 41
  • 3
  • possible duplicate of [Connecting Rails 3.1 with Multiple Databases](http://stackoverflow.com/questions/6122508/connecting-rails-3-1-with-multiple-databases) – Scott Holden Nov 30 '14 at 22:33
  • 2
    Re "I'm thinking Rails' ActiveRecord layer (along with the pg and activerecord-sqlserver-adapter gems) should abstract away which RDBMS system I am using", no it won't. AR gives you pretty much zero portability. If you're only doing simple things then you should be okay but if you end up doing anything non-trivial (including date or time computations inside the database) then you might end up having to write your own portability layer. You will need a very thorough test suite for anything touching the database and you will need to test against both databases and all supported versions. – mu is too short Nov 30 '14 at 23:08
  • @ScottHolden: No, that's about connecting to several databases at the same time, this question is about supporting deploying on top of different databases. – mu is too short Nov 30 '14 at 23:11

0 Answers0