Rails & MSSQL 2008 - Will We Hit Barriers?

2020-04-05 05:00发布

问题:

The company I am working for is looking to switch platforms from ColdFusion 8 / Windows to Ruby on Rails / Linux. Our database solution will remain as MSSQL 2008 on Windows. I will likely follow up with a series of questions relating to this migration separately, but for now I have a MSSQL & Rails specific question.

Back in 2006 when I was working with Ruby on Rails for the first time, support for MSSQL installations was pretty iffy. Things worked for the most part, but ActiveRecord couldn't cope with certain functions lacking from T-SQL. Primarily, I recall auto-paging not working due to a lack of an OFFSET keyword like the one found in MySQL.

I am curious if our primary DB server running MSSQL 2008 will be able take advantage of most of ActiveRecord's functionality. If there are particular features that are not available, I'd be curious as to what they are.

回答1:

Yes, there will be pain.

We're running Rails/SQL Server in production at the moment. All of our develompent is done on OS X / linux, and deployed to linux app servers.

We went with JRuby in the end as connecting via JDBC rather than ODBC was much less painful. JRuby itself is a good platform, but we've had no end of trouble due to quirks with 3rd party gems and plugins which often don't work under JRuby (especially if they've got native extensions).

There are still holes in the support - paging is still iffy, but kind of works now. From memory there are some quirks around unicode and character encoding as well.

The only reason SQL Server is used is because that was what the IT infrastructure team mandated. MySQL/Postgres is a much better solution if possible. It all just works.