Thomas Schedler
Thomas Schedler
Co-Founder & CEO – Sulu GmbH
Sulu's technical Master Blaster. Tries to keep our code on it's toes and to master Heston Blumenthal recipes on his very seldom free days.
@chirimoya

Sulu 3.0 Preview: How Sulu CMS is Evolving its Content Storage Architecture

The release of Sulu 3.0 is getting closer! Following up on the talk at Sulu:Touch (slides), we want to give you a preview of the core improvement in Sulu 3.0: the new content storage architecture. For three years, we have been building and testing a modern, versatile alternative to PHPCR, and in this article, we will share some background information about the change.

The Evolution of Sulu CMS: Addressing Core Storage Challenges

When we started creating Sulu 1, the PHP Content Repository, known as PHPCR, was a great choice as a content storage layer. PHPCR provided many features out of the box, enabling rapid development without having to write a storage layer from scratch.

Fast-forward a few years. While PHPCR remains a reliable content storage system, we identified a few limitations. PHPCR does not scale well, and features that are standard with other content repositories, such as versioning, have to be bolted on. Moreover, PHPCR did not gain the momentum needed to flourish in the PHP world.

In the end, we at Sulu were the only relevant users and maintainers of PHPCR; everyone else regarded PHPCR as a black box featuring a non-standard query language. For a few prospective users, PHPCR was even a reason for not using Sulu.

So we took all our experience with Sulu and the feedback from developers and began searching for alternatives.

Why A Doctrine ORM Entity is The Future of Sulu's Content Storage

For the search for a new storage system, we set up a couple of requirements:

  • Fine-grained loading: No bulk-fetching of unnecessary content
  • All features included: No more bolting-on of services to support essentials like drafting or versioning
  • A flexible storage architecture: Every page or article is a Doctrine ORM entity, and any entity shall be extensible to hold content
  • A standard query language: Content shall be retrievable through basic SQL or DQL queries

After evaluating third-party alternatives like Neos, we concluded that we had to design our own storage system, built on top of Doctrine ORM’s concept of entities.

The new storage system introduces a multidimensional page model that simplifies working with versioning, staging, and languages. We spent three years building, testing, and improving the system extensively until it was ready for production use.

What to Expect in Sulu 3.0

The new storage system is still a work in progress. While the core system is tried and tested, various Sulu bundles have to be converted to use the new system. As of this writing, the Article bundle conversion is complete, while the Snippet, Page, and CustomUrl bundle conversions are on their way.

Sulu 3.0 will be completed when all bundles are based on the new storage.

The new storage system is the most prominent change, but it’s not the only one. We have been working hard to reduce the number of external dependencies and focus on a few well-maintained and future-proof dependencies, such as FlySystem.

We used this occasion to remove deprecated classes and services; see sulu/UPGRADE.md for a complete list.

What Sulu 3.0 Means for Different Users

The new document model appeals to different kinds of users alike:

  • Developers will benefit from familiar standards like Doctrine or SQL and the new model’s intuitive and flexible concept. Moreover, they won’t need add-ons like Jackrabbit anymore.
  • Content Managers will enjoy the benefits of versioning as they move documents through the writing, editing, publishing, and maintenance stages. 
  • Visitors will appreciate a considerable speedup in document retrieval. Our measurements show twice the throughput and half the latency compared to PHPCR.

Whether you directly work with the new content model, run a Sulu site, or simply use Sulu, the improvements will significantly enhance your Sulu experience.

For Sulu developers that maintain a near-vanilla Sulu, the SuluPHPCRMigrationBundle provides a convenient migration path. Sulu instances with custom content logic can use custom migration paths to move to the new content model.

Preparing for Sulu 3.0

We hope you share our excitement about the upcoming Sulu release! Still, we want to ensure that the final release is rock solid. We maintain a to-do list in Issue #7672 that everyone can track for progress. We anticipate that Sulu 3.0 will arrive around the end of March after all bundles have been upgraded to the new model.

Until then, you can use the waiting time to review our upgrading documentation and, for Sulu instances with custom document logic, plan your migration path.

With the PHPCR legacy behind us and a flexible, Doctrine-centered document architecture ahead, we’re excited to see what you’ll build with Sulu 3.0.