DEV Community

Cover image for Headless Ecommerce: Real World Test
Brian Burton
Brian Burton

Posted on • Edited on

Headless Ecommerce: Real World Test

We recently completed a project that had complex requirements that wouldn't allow us to use any off-the-shelf hosted ecommerce platforms. We needed to be able to modify everything from the authentication system to simplifying the checkout process and nothing we found checked all of the boxes.

My responsibility was in choosing the OSS platform to build off of and so I dug in and built rough versions of the features we needed in three popular ecommerce platforms: Saleor, Sylius and Medusa JS.

Saleor (Python)

I've been a Python developer for about 15 years and this platform had the steepest learning curve by far. The documentation is sparse requiring the need to dive into the codebase to fully understand the Saleor way of doing things. It took over a week to get a semi-functional prototype almost working before we decided to abandon the platform due to its inflexibility.

Saleor's primary benefits are that it has a very active development schedule and out of the box it's designed to be scalable as it's essentially a monolithic GraphQL service with a job scheduler running beside it. Getting it running in a serverless environment was fairly straightforward, once you understand the architecture (which I gleaned from a Github issue and not the documentation) and all of the requirements.

That's about all of the pros. Saleor is moving away from its plugin architecture, where you could modify how the Core functions, in favor of a Shopify-style app architecture, where you create complete completely isolated apps that acts as intermediaries to provide the customizations you need. The App SDK is very limited, keeping you at an arm's length from its core functionality and preventing the level of customizability you'd expect from an open source project. Here are two examples of its inflexibility and complexity:

  1. Imagine you want to create a simple custom mutatations. To do that you're required to run a completely separate Apollo server to provide Apollo Federation to combine the multiple services into a single GraphQL API. This would make perfect sense if this was a hosted product, but not for an open source self-hosted platform.

  2. A more specific example of the absurdly high wall it's built around itself, it's currently (3.21.0) impossible to set a customer's password without the customer's intervention. You're required to force them through the "Forgot my Password" flow, but if you need to set or change a customer's password the only solution is to modify Core, which at that point you've essentially forked the project.

Opinionated frameworks and platforms are good, but this one feels almost like their roadmap is designed exclusively around their hosted product without consideration of their self-hosted userbase. One developer described it best: "Open sourced Shopify."

Sylius (PHP/Symfony)

In the PHP/Symfony world, Sylius appears to be the most mature "headless" ecommerce platform in that ecosystem. I put "headless" in quotes because it's often listed as a headless ecommerce platform in other lists, but in reality it comes with a fully functional storefront.

We didn't get very far with this one for two reasons:

  1. Following the quickstart guide, they recommend using the Sylius-Standard project to create your development environment. That process is completely broken as it required several restarts to get the database image working only to discover the configured PHP version is incompatible and package.json is missing a library. We ended up building the dev environment from scratch wasting two whole days.

  2. Once the dev environment was running, it ran like a dog on a box with 64GB of RAM. Every single Ctrl+S triggered a 20+ second rebuild by a separate Docker container that exists only to rebuild the assets. Page loads in the admin area took nearly 10 seconds to load. I have no idea why it ran so slowly and frankly I didn't want to lose the time to find out.

I love Symfony and the Sylius framework is written in an understandable and logical manner, but it is far too unpolished and difficult to develop on to consider for this project. This platform was abandoned pretty quickly.

Medusa JS (Typescript)

Compared to the others, it was a breath of fresh air. It's clean, simple modular architecture made adding custom features a breeze without spending days digging through documentation and Github issues.

You want to create a custom API route? Just drop it into the /api directory. Boom, done.

You want to change some core functionality? Create a module. Boom, done.

Want to distribute your module? Make it a plugin. Boom, done.

We created a fully functional prototype with all of the functionality we required in a day. It's lightweight, has a logical code structure and didn't appear to be limited by artificial walls. This is how you build an ecommerce framework.

Conclusion

I dislike publicly critizing open source projects as it's difficult to fully understand the choices behind their roadmaps and I don't want to discount the countless hours that have been invested to get the platforms to their current states. I truly appreciate the work they've put into creating these projects and hope that this is seen as honest feedback.

However coming from a developer/PM perspective where I was required to review and choose which project was the easiest to develop on, most extensible and most mature, the race wasn't even close. Medusa will most definitely be at the top of the list for the next headless ecommerce project.

Top comments (0)