Hi all,

I found a MS SQL Server "driver" (sort of database API layer extension) for Drupal 7 in https://drupal.org/project/sqlsrv . This driver seems to work with Drupal 7, but I couldn't find anything for Drupal 8.

Does Drupal 8 support MS SQL natively? Or... is there any extension for Drupal 8 allowing to use MS SQL as the database engine?

I want to use MS SQL but I don't want to get stuck in Drupal 7 in case that the module is never ported to Drupal 8. I want to be sure that, in the future, I'll be able to upgrade to Drupal 7 easily maintaining the same database engine (MS SQL).

Thanks!

Comments

Overflowed’s picture

It seems that MSSQL is not supported natively, according to: https://api.drupal.org/api/drupal/core!INSTALL.txt/8 .

Is there any other option / module available?

Thanks!

bojanz’s picture

No.
And using a non-supported database is hard even in Drupal 7, there is no guarantee modules will work (I believe Views has compatibility issues, etc).
So use MSSQL only if you really know what you're doing and are prepared to troubleshoot the entire system.

Overflowed’s picture

Thanks a lot for your answer.

I really thought that MSSQL was fully compatible with Drupal 7 thanks to the compatibility "layer" provided by the sqlsrv module/driver. I didn't know that there were compatibility issues with Views or other modules.

WorldFallz’s picture

I've used it extensively, and only ran into a couple of issues that were db specific (one date/time issue I have yet solve). Otherwise it's been pretty seamless. But yes, you do need to be prepared to be able to troubleshoot when issues arrive. With over 7500 reported installs though, it seems to me it does work pretty well outside of my own experience.

With commerceguys being one of the driving forces behind the mssql driver, I'm hopeful it will eventually be upgraded to d8. I wouldn't ever expect to make into core though. 7500 may sound like a lot, but it's still only a small portion of total drupal installs-- no where near enough to justify inclusion into core.

bojanz’s picture

With commerceguys being one of the driving forces behind the mssql driver

Well that's the thing, we're not maintaining it, and I don't know of any plans to do so.

WorldFallz’s picture

That's the first I've heard that-- thanks for clarifying. I would highly recommend that it's probably something that should be very clearly reflected on the project page though. Looking at it now, it's still categorized as 'Actively maintained' and 'Under active development' and 2 of the 3 listed committers are commerceguys. It even still says "This work is supported by Commerce Guys, provider of innovative ecommerce solutions for Drupal." which also indicates 'ongoing'.

I have some new sites coming up in the next couple of months, and that will likely have a major impact on the decision of which db we use.

Since commerceguys (more specifically damien) are pretty much single handedly responsible for the driver, may I ask why you've given it up? And what db do you primarily use then?

I don't particularly have any allegiance myself, but our internal dba team is really pushing me to migrate all of our sites to mssql which, until now, I thought was feasible.

david_garcia’s picture

It's experimentally working on D8 now:

https://www.drupal.org/project/sqlsrv

Greetings.

chandan_jha18’s picture

This connectivity works only when Drupal is running on windows. For Linux, it is not too smooth.

sachand’s picture

Are the steps are same for Drupal 8 as of Drupal 7 ?

I am not able to install this on drupal 8 beta12 . getting error
Fatal error: Class 'Drupal\Core\Database\Driver\sqlsrv\Connection' not found in C:\Apache24\htdocs\drupal8beta12\core\lib\Drupal\Core\Database\Database.php on line 381

I am using Apache on windows 7

Please help.

Santosh C

WorldFallz’s picture

separate issues warrant separate threads. But realize that this type of thing is exactly the risk you run using beta sw. Not to mention the fact that very few forum users will have experience with sqlserver AND d8 so you're not likely to get an answer in the forums. I recommend checking the module's issue queue.

As an aside, I've abandoned the idea of using SQLServer based on this post in combination my experience using it. It's just not worth it. The only reason we used it in the first place was 1) inhouse expertise and 2) a large commercial drupal shop was originally behind it.

The perceived benefits of #1 never came to fruition. And with no large commercial shop behind it, it runs a serious risk of going unsupported. SQLServer is commercial software so the costs involved typically limit the amount of open source developers that will be able to support it.

Then there's all the little incompatibilities that crop up from time to time. I didn't experience many, but when they occur they are time consuming and irritating.

Switching over to a full RHEL7 based lamp stack has been awesome. And while I have no hard data to back it up, and it's really comparing apples and oranges, I can say that anecdotally, the performance has been better on LAMP as well.

as usual, ymmv.

david_garcia’s picture

SQLServer is commercial software so the costs involved typically limit the amount of open source developers that will be able to support it.

MSSQL is free and full featured for databases up to 10GB in size, and considering it is one of the best database engines out there alongside with ORACLE, that's a pretty good deal.

And then there is the MSSQL Web Edition (that you can only get through a cloud provider) that has very competitive pricing.

MSSQL also has better analysis and optimization tools and requires less "optimization hassle" as it usually manages everything itself automatically, so in the long term it will give you less performance headaches and will amazingly scale without issues.

Of course, for "websites" or "small/simple" projects, you won't tell the difference or see any benefit in this. This just makes sense on very complex and nested relational data models (something not worth even trying with D7, but that is starting to become feasible with D8) and with large datasets.

Then there's all the little incompatibilities that crop up from time to time

That is true. The 7.x-2.x and 8.x-1.x version of the driver has many compatibility fixes and performance improvements compared to the original driver implementation by Commerce Guys that was quite frustrating to use.

I can say that anecdotally, the performance has been better on LAMP as well.

Properly configuring the PHP stack to run on IIS/MSSQL at its best is "difficult" because there is little documentation out there (and some stuff that you simply won't find...), and the truth is that MS has only started to take PHP "seriously" since about the end of 2013, and only because they want *everything* to work perfectly on Azure (+ change of management and overal direction in MS).

You can get (at the minimum) the same performance on IIS/MSSQL as you can get on NGINX/MYSQL. But doing so on the former will require more involvement and expertise.

And I said at the minimum because if you properly leverage advanced IIS/MSSQL features such as IIS Ouput Caching then you can see a huge difference without the need to resort to stuff like varnish.

LongboardsUSA’s picture

Happy I found this before spending time trying this.
I know this is an old answers, but still much appreciated. Time saver!

Tx. Carver.