Pluggability in practice: MongoDB support in core


What: MongoDB is an open source NoSQL document database, primarily developed by MongoDB Inc. I believe this database provides an excellent fit for Drupal and this potential has been realized in Drupal 8. For the first time, Drupal is capable of running on a NoSQL database. We should bring this support into core.

When: MongoDB integration with Drupal core and Drupal CI both is already written and by DrupalCon Los Angeles most tests (that do not utilize SQL themselves) are expected to pass. This work will continue so that when 8.1 opens we will be able to add this immediately.

Why: Benefits the core developers by making test runs faster (on Feb 25, I measured UserCacheTagsTest:::testEntityUri to be 18s on MongoDB vs 29s on MySQL on my laptop and I believe further optimizations are possible) and unearthing very hard to find bugs. We call Drupal 8 truly pluggable but only by turning the theory into practice can we make sure this actually works and stays working. To quote a recent issue comment:

a lot of the recent fixes to make PostgreSQL tests pass were in fact not specific to PostgreSQL but improved reliability of both runtime code and tests e.g. by adding missing sorts, etc. So fixing PostgreSQL actually improves stability for everyone.

This is equally true to working on MongoDB -- beyond countless minor issues I have discovered data loss bugs and even a security hole. End users can enjoy a faster site. (I will talk of the disadvantages too.) Also, I believe including MongoDB support in core will broaden Drupal’s appeal.

Who: A MongoDB maintainer (slashrsm have voluntereed and if this proposal succeeds then funding is likely to be available as well) will navigate the core queue and I will help with advice and some coding.  This model is being used for migrate and works really well. 

Session Track

Core Conversations

Experience Level


Drupal Version