Hacker News new | ask | show | jobs
by DelaneyM 3647 days ago
I spent two years trying to innovate on Magento, because it was the platform before I got there and rebasing seemed like overkill, and it almost broke me as an engineer.

My experience (and I'm not even going to complain about the XML!):

The code base is horrifying; we would often trace bugs through the stack, realize they were in magento core files, then face really difficult decisions about furthering our fork.

The code is deeply integrated from UI to DB. If you change it, upgrades won't apply cleanly. But you need to change it (or the data structures/applications therein) to implement any non-core features.

Speaking of upgrades, they are mostly done by opaque and undocumented upgrade scripts, and tend to break plugins or addons...

Which are generally poorly written and untested, even highly rated ones in their web store, but their quality isn't even the biggest problem. The absence of a sane extensibility model means they virtually can't coexist consistently, and when they do they break on (or need rigorous requesting due to) upgrades...

The EAV table layout wouldn't be totally horrible if it weren't so badly implementated. They put everything, even system data, in EAV tables; not only did this make it hard to extend, but it put a huge load on the (outdated) ORM.

Performance was an exercise in caching like no system I've seen before, entirely due to this design choice. The downside of that is that server restarts under load could cause a full system panic as new web hosts put an unbearable load on the DB, which could throw off other web hosts when their ORMs blew up by timing out all their pooled DB threads, which started a cascade through the rest of the system.

It was possible to deploy a single cache shared by all your Magento servers, but even stock Magento would pepper that cache with dozens of serialized queries to serve a single page, making the network overhead barely worth it. Plus, this meant you couldn't clear the cache under load or you'd be down for an hour, and clearing the cache was a daily necessity because their tagging system to rebuild the cache incrementally was horribly broken. (Only barely worked using Redis, which was both recommended by Magento and provided by a 3rd party unmaintained driver and officially unsupported.)

We ended up reimplementing all our e-commerce properties on a custom node platform by assembling high-quality atomic tools for the important bits. The technical debt of the transition was paid off in 3-6 months on our feature schedule and has paid dividends since, and we easily handle double the load on ~10% the infrastructure spend.

1 comments

Worth noting that Magento 2 is rewrite that actually uses some proper engineering practices.

No idea how good it is but version 1 was horrifying.

The fact their github has 1274 open issues and 179 open pull request at the time of writing suggest maybe nothing has changed: https://github.com/magento/magento2

But none of that matters because Magento 2 still can't serve a dynamic request in less than a second in even the most optimal conditions.

https://blog.amasty.com/magento-1-vs-magento-2-performance-c...

The Magento framework builds static sites with a (slow) dynamic CMS system. It's garbage.

We got it down to an average ~400ms under load with aggressive full page caching (including our own hand-rolled component caching) and edge caching of all static assets (freeing up the servers to be optimized for dynamic content).

This should not be considered an endorsement; getting sub-second pages was a downright herculean engineering effort requiring system-level optimizations beyond what should ever be required of a pre-packaged system.

I've spent enough time in highly customized Magento in my day to both be impressed, and deeply concerned for your well-being after such a task.
True that we left before 2.0.

I was excited to hear that 2.0 wasn't backwards-compatible, but apparently (from the community feeds I'm still connected with) things haven't improved much.

The problem seems to be that they just didn't have a deep engineering bench at Magento, and as the red-headed stepchild of eBay a few years after their acquisition they had no way to hire. (I was actually pitched a "CTO of Magento" job at eBay Enterprise a few years ago, but the comp package wouldn't have matched my lead engineers' at the time and most of the dev team was overseas and chosen based on price. It looked like a nightmare.)

edit: Apparently they've since been sold to a private equity firm to be managed for cashflow, which is a common outcome for stagnant enterprise companies with vendor lock-in and rich fees. So much for buying their way out of their code hole.

> from the community feeds I'm still connected with

Can you please elaborate on what these channels are?

Indeed, I'd like to know for our benefit.
The tricky thing about looking at number of issues is that we have a high volume of interaction on the repo as well as a lot of cruft from even before the beta (I'm looking into winnowing these down). I'm spending 50% of my time on the road interacting with developers, and most of what I'm hearing is that M2 is much better to work with for professional PHP developers, but that there are improvements still needed. We're damn lucky to have an engaged community which will help us to constantly improve, assuming we continue to listen to them (which is a big part of my job). We also have our most senior PM overseeing developer experience.

Regarding PRs, this wasn't something we even _did_ before 2015. I wish we could have a quicker acceptance of PRs, but many are not in a proper state to accept - for example, several PRs have CI failures which are the responsibility of the submitter to fix.