Why Drupal 7 is better for REST API / IoT /Decoupling than Drupal 8

Submitted by dryer on Sat, 03/26/2016 - 19:01
Dumb IoT fridge idea

Drupal 8 is a leap forward in terms of architecture. It's a significant overhaul of the rather ancient imperative codebase from 2001 to something that is a mix of that and modern Object Oriented Programming methods familiar to developers using Java or other similar more advanced languages than PHP was fifteen years ago.

This overhaul may be five years late, but at least it's here today in 2016. There are also plenty of new caching layers that will make delivering websites to users with higher performance than ever before. But all of this does not come at zero cost, as you can read later on.

Another buzz around the Drupal 8 release is decoupling and especially the REST API. In many cases Drupal 8 is envisioned as a backend to IoT (Internet of Things) backends, where thousands or even millions of devices will connect to Drupal for getting and storing data.

Drupal as a backend

The cold truth is that for this kind of use cases Drupal 7 continues to be the better option. With the added overhead of request handling added in Drupal 8 means that each request to a Drupal backend will actually be slower than Drupal 7 and by a large margin:

Drupal 8 is slower than Drupal 7

This means that if you are building something that is a data centric application that is expected to provide authenticated users access to a repository of data (stored in Drupal), Drupal 7 is the better choice. It's also more robust and will be supported for years to come.

But if you're building something to serve potentially hundreds of thousands of devices, why would you want to use a Web Content Management System (WCMS) for there are better solutions and technologies that will scale far better.

It's common to see the Drupal Oriented Architecture (DOA) taking hold in Drupal shops, but it's not always the best way forward. Nodal.js, for example promises API Services Made Easy With Node.js. Drupal is good for creating web sites, not industrial scale services required for elevators and other critical systems.

Don't Drupal, just because Drupal. And if you do, Drupal 7 might be a better choice.