CMS Comparison: Drupal vs. KeystoneJS

New Content Management Systems (CMS) are being released at an increasing rate, partially due to the shift towards JavaScript-based applications, microservice-based architectures, and NoSQL databases. Established CMSs are slower-moving when it comes to making it easy to embrace newer technologies and approaches, and that opens the door for competing products. Therefore, it’s worth comparing an established PHP-based CMS with a significant amount of people using it and a popular JavaScript-based CMS.

What is Drupal?

Drupal is a primarily PHP-based CMS that was first released in 2001. Sixteen years later, the current version is Drupal 8. A new minor version (Drupal 8.1.0, 8.2.0, etc.) is released every six months. The current minor version (at the time of writing) is 8.3.x, with the 8.4.x series coming soon. Drupal has a vibrant community and a large selection of contributed modules. Somewhat uniquely, it also has a security team that module authors can request free coverage from. They must go through a quality control process to be approved, and the focus on quality means that the Drupal community has historically had less duplication of functionality across extensions and higher-quality code.

What is KeystoneJS?

KeystoneJS is a Node.js-based CMS that was first released in 2013. It runs on the popular Node.js framework Express and uses the well-known MongoDB as its NoSQL database. It does not enforce a particular frontend technology and is designed to be lightweight. It supports several templating engines and CSS preprocessors. It takes full advantage of the modular architecture of Node.js.

Comparison of “Key” Features

Templates for Content (“Content Types”)

Content templates, or content types, are distinct arrangements of content such as News Articles, Photo Galleries, Blog Posts, or Events. In some systems, they can also include other types of data for display, such as Team Members, Conferences, or Testimonials. These templates typically group together various data fields — text, images, files, numbers, Google Maps, links, intra-site links to other content, etc. An administrator typically fills out a content creation form in order to add content to the site. Drupal and KeystoneJS both provide a mechanism for this.
Drupal
This is built-in with Drupal. Through an administrative interface, one can set up content types and add fields to them. Then, editors can go in and produce content based on those templates.
KeystoneJS
In KeystoneJS, different kinds of content are achieved using Data Models. These are configured with JavaScript and resemble Mongoose templates. They are not only for content types, of course; KeystoneJS also uses data models for users. It’s quite flexible. This is how the default PostCategory model looks:
var keystone = require('keystone');

/**
* PostCategory Model
* ==================
*/

var PostCategory = new keystone.List('PostCategory', {
autokey: { from: 'name', path: 'key', unique: true },
});

PostCategory.add({
name: { type: String, required: true },
});

PostCategory.relationship({ ref: 'Post', path: 'posts', refPath: 'categories' });

PostCategory.register();

Lists of Content (“Views”)

The most common content display is the web page. When we read blog posts, shop online, or check out the news, we make use of this format. It usually consists of a title, body, and perhaps sidebar elements. However, it is by far not the only way to display content. There are other ways that we may see content displayed: tables, lists, interactive maps, and featured content in a side column are a few of these. CMSs typically provide some way for you to group content like this. Drupal and KeystoneJS are no exception.
Drupal
This is built into Drupal core (from version 8) as well; simply enable the Views module. You can then create, filter, and sort dynamic lists of content.
KeystoneJS
In KeystoneJS, lists of content are achieved using its built-in support for templating. KeystoneJS uses typical MVC (Model-View-Controller) patterns to model data, UI, and business logic. So one would simply create a template and build the necessary structure to render data in the desired format. This is very flexible, though it generally does require some programming knowledge.

Component-Based Content Modeling (“Paragraphs”)

Content components are reusable, often business-specific patterns for building content or one-off pages. For example, one might have components for an intro, a three-column insert, an annotated video, a captioned image, slideshow, hero image with CTA, and so on. These kinds of components can save editors from having to manually write the HTML or use specific WYSIWYG features to achieve what they want. It also simplifies serializing the content into different formats, such as if it is consumed through GraphQL or a JSON API.
Drupal
A popular way to build reusable components in Drupal is the Paragraphs module. This allows an administrator to create the components and an editor to add them as needed to articles, mixing and matching at will.
KeystoneJS
Achieving this in KeystoneJS currently requires custom development, but there is an open feature request for it. KeystoneJS supports extensions (plugins), so implementing such a plugin would be one possible way to solve this. The most likely solution would be a custom admin UI that implicitly created components in other KeystoneJS lists (Mongoose collections) and relating them to the primary content using their IDs. There would need to be a way to detect this situation intelligently and display the content of the referenced content, rather than just its ID. Naturally, one can simply create reusable component templates and embed those in other templates as needed if a UI is not required. And this is already possible in core KeystoneJS.

So What Should I Use Then?

Drupal makes it fairly easy to set up sophisticated content management workflows, but it is heavier; one can easily wind up with a lot of extensions installed despite not using most of their functionality. KeystoneJS requires somewhat more work upfront, but it is also less resource-intensive to run and more straightforward for a developer to customize. This helps keep things more lightweight. Overall, it makes fewer assumptions about what it should do and focuses on providing a decent Admin UI, a rich API for database management, and a tested JavaScript-based technology stack.

Which tool is best for the job? That depends on your budget and goals.

In general, Drupal comes with more “out of the box,” and I would choose Drupal for projects that want to do more than just display content from the start (for example, the Red Hat website) and have a decent development budget. Drupal has a wide array of built-in and community extensions, such that custom development is not always necessary, but expertise is typically required to navigate the available functionality and build the project. I would avoid it if I were on a shoestring budget and did not have development experience myself. KeystoneJS is more flexible. An example of a website built with it is Yoga Australia. True to the meaning of CMS (Content Management System), it is great for websites that are content-focused. It is also easier for JavaScript developers to understand, as it integrates several common technologies. There are many CMS choices to choose from today, with Drupal and KeystoneJS being just two from the myriad options. If you have questions or need help navigating the crowded CMS landscape, please feel free to reach out to our team. We’re happy to help guide you to the best option for your project and budget - and we’re only an email or phone call away!




Project Ricochet is a full-service digital agency specializing in Open Source.

Is there something we can help you or your team out with?