by tedsuo · 14y ago · 0 comments
- NOT AMENABLE TO SOURCE CONTROL
Half the code lives in the database, configuration is all mixed up with content, and there's no reliable programmatic way to extract it. It makes doing deployment a nightmare.
And the worst part? Drupal developers by and large have such a narrow range of experience that they don't even know what they are missing. They have no idea what good coding standards look like, a lot of them don't even have a development/production separation: they just hack away on the live site with no source control or backup. And no one writes tests, or sees why they would be useful.
Some of the big professional drupal shops appear to have basically written their own cms on top of drupal, with a bunch of terrible hacks to try to make source control kind of work, and just use the drupal name basically as a marketing technique.
So glad I don't have to deal with any of that insanity any more.
If you want to complain about Drupal be my guest. The ground's very fertile, but what you've posted here is FUD.
Code in the database? No, just no. While it is technically possible to stuff code into the database community best practices (not to mention common sense) strongly advise against this practice. What you are describing is the system handing you enough rope to hang yourself, not it's default behavior.
Configuration lives in configuration tables.
Content lives in content tables.
"they just hack away on the live site with no source control or backup"
It would be a mistake to take the fumblings of a few scrub freelancers or interns and extrapolate that as being the norm for all (or even most) Drupal developers.
For all core modules and all quality* contrib modules there are $N_load() functions to extract these (reliably) from the database.
* With ~8000 contributed modules to choose from, quality varies wildly. While unfortunate, it's to be expected when you've got that many chefs in the kitchen.
And that, in a nutshell, describes why Drupal's adoption rate is as high as it is compared to development frameworks developers actually enjoy working with. No fucking code. Non-developers can actually get results with the system without having to resort to the kind of miserable hoop jumping we developers subject ourselves to in an attempt to make sure nobody else on the team fucks something up.
View got changed? Log in and change it back. Absolutely, positively MUST have an ongoing log of changes to your view/content type/custom field? All of these are exportable to code and can either be imported raw or live in modules.
I suspect you've worked with exportables at some point so I simply mention this for any spectators that aren't aware there are a number of strategies for getting your configuration into code (and thus revision control) if that's your thing.
Also, for the uninitiated, apendleton makes an excellent point about deploying config changes from dev/staging to production. It sucks, plain and simple.
Suppose, in a Drupal project, you had two such features being developed simultaneously, and each added different new fields to a given content type, with corresponding changes to views and authorship workflows. Assuming it were even practical for each developer on a Drupal project to have their own development instance of the database powering a site (which it totally isn't), it's true that each developer could export their own version of the given content types, views, etc., and commit them to version control. The exported blobs are pretty much opaque to many Drupal developers (or non-developers, as you say), though, and may not be expressed sufficiently sanely that Git could figure out what changes actually took places. When these features were ready to be merged, would the merge work? Who knows? What if there were merge conflicts? Would developers be able to resolve them? Worse, what if Git's notion of the correct merge strategy didn't actually produce a semantically correct result? All of these operations take place on generated code that nobody wrote and nobody reads, which is scary enough that the whole process wouldn't be trustworthy.
Exportables are yet another in a long series of efforts in the Drupal community to attempt to address a deficit they have with respect to most other web stacks, and again they've done it in a way that doesn't really deliver the benefits of the feature as it exists elsewhere (see also Drupal's "database abstraction layer" or its supposed "object-oriented design").
The benefits of having a UI to manage core application behavior is lost on most clients. Most are terribly scared of editing a view, content type, or pretty much any other module specific configuration. I speak from the experience of someone whose developed about a dozen or so Drupal sites.
Actually, I think what we should be asking is this: Do CMS databases and VCS really have to be two completely seperate universes? I would say no. There is room for a new type of CMS database design that includes all the functions of a VCS.
The code defines the default configuration.
If the user changes the config using the UI, the change gets written to the database. At the same time, a little telltale light (or something) tends to appear in the UI display, to alert the admin that something's been changed on the site, but not in the code.
Your developer can then come along and pull a report that lists any configuration that's been changed in the UI but not migrated to the code. Pressing a button spits out a code-based representation of that configuration. The developer finds the right file, pastes in the config change, checks into Git or SVN. Now the config is once again captured in code, and ready to be deployed in a consistent manner.
I'm not sure if the Drupal 8 team is using this pattern or something different. Still trying to catch up with this stuff.
The UI is enabled on development environment, allowing for extremely quick experimentation (possibly by non-technical folk), but you still get (most) of the benefits of changes being in code.
ETA: It's not perfect, but it's on it's way to becoming the best of both worlds. Drupal 8 is making significant progress in that direction.
"Configuration lives in configuration tables" : the OP's point exactly. Configuration should live in a VCS
Bear in mind also that "configuration" van be so complex with Drupal it's often more along the lines of being "an application". A non-trivial view is hugely complicated and yet all its settings and code live in the database entirely, with no way to either back it up in a VCS or deploy it from a development environment to a live environment without manually copying the settings from one to the other.
That's not version control, that's an export function.
Drupal 8 is continuing to make this easier and more powerful, by (amongst other changes) making configuration live in the filesystem by default, turning the copy in the database into (one of several options for) a cache.
In Drupal 6, the only way to reproduce an environment was with a massive install profile for the project, and the average Drupal developer was entirely clueless to matters of testing and version control when compared to the average Django/Rails/CakePHP developer. This made for many painful projects and unhappy clients, usually beginning 6-8 weeks into the project when the issues of database drift became inevitable.
And like you said, everything lives in the database. So the chances that some production issue (or new issue only seen in dev) was caused by an errant user action in the Drupal UI was pretty high, and this made debugging a nightmare -- where is my issue really coming from?
I'd just about forgotten about my Drupal days of yore, and between the "click monkey" analogy and the "clear the cache" nostalgia, the author sure conjured up some bad memories!
Features and things like http://drupal.org/project/drush_make is what makes a lot of the drupal distributions (http://drupal.org/project/distributions) that keep popping up because sourced controlled, feature driven development is now possible in drupal.
Also the testing part has been improving, and although very few of the contrib modules have tests most of core has automatic testing in place for when you submit a patch as you can see in the issue queues (http://drupal.org/node/466576).
- How to deprecate a feature (I created http://drupal.org/node/1400346 to attempt to solve this, but admitedly, it's a very dangerous module) - Ever created a feature with tons of things in it? Hello, 5 minute load times for admin pages! - How do you merge two features together? How do you commit just one feature and not another (say, one you're still working on?)
The CMI initiative will hopefully take care of a lot of the messiness and bugs in Features.
I've merged features together and it was not as hard, at the end it is all code, you just need to be very careful, but at the same time you have git to revert if something goes wrong.
I don't understand the part about committing just one feature. You can commit just one =P.
I finished up a project earlier this year that has more than 300 modules active in a custom install profile, with 10MB of features modules stuck in there. We committed/contributed to a few fixes in core and Features to speed it up greatly. That's out in the wild on major sites and doing fine.
We didn't have any terrible admin screen issues, or indeed any terrible issues beyond occasional painful version control collisions.
Drupal lets you get a ton of shit accomplished without making you understand a single line of code, have a reasonable Dev-Stage-Prod workflow, QA, even version control or backups, etc., but it's completely possible to do all of that. That means that it can scale from anywhere from something like a 16 year-old's shared-host fanfiction site to say Whitehouse.gov.
Of course that means that there will be tons of fuckups live-coding (or live-configuring) on production, or people that don't export and version things in environments when they should, and that people will construct fragile combinations of modules and configuration where a tiny bit of code would have sufficed, or write tons of fragile custom code with no tests or security review when there was already a module for that.
But allowing people to be fuckups doesn't force them to be, and they can be trained.
Scaling to Whitehouse.gov is not impressive at all. Like a 16 year-old's shared-host fanfiction site whitehouse.gov really is nothing more than a content site, albeit a very large one.
The problem is Drupal isn't content to simply be a CMS. It has to pretend to be a framework for developing web apps as well, and for that it's just plain terrible.
Drupal is only for when what it (or modules) can provide is a vast majority of the requirements of the project. Anything that couldn't be described as "nothing more than a content site" probably would not be a good fit.
The only thing it has to offer is when what you need is one of the myriad things it can be configured to be, because then you get a bunch of community eyes and tests on a bunch of code you didn't have to write.
Edit: Discussion on recent improvements to PHP's and its ecosystem (which are exciting progress in a direction I believe there is more room to go) http://news.ycombinator.com/item?id=4605715
What do the current offering of PHP frameworks lack that Python/Rails provide?
This does not say much about Drupal being good in absolute terms. It only tells us the obvious point that Drupal is a lot better then your old application.
What you state would have been just as trough had you developed in Rails, Django, and maybe even in PHPnuke. What you don't state, is why Drupal was the better fit compared to modern alternatives. Is it?
I don't agree with your suspicion that big shops are hacking core and building custom CMSs upon Drupal in a vain effort to try and gain source control features. Rather... I'm aware of big shops sticking to Drupal bets practices and using Features, Strongarm, Plumber and other modules to get configuration into code and keep it source controlled.
If Drupal deployment were the nightmare you s=describe, then the phenomenal adoption of Drupal that we see today would make no sense. Why would the Georgia Tech Authority decide to move SIXTY-FIVE sites off of a Oracle, Java, Vignette solution and onto Drupal? Well.. It is isn't because they like nightmares during deployment.
Drupal is growing up. The issues that plagued us 5 years ago when I got involved are being solved with varying degrees of success and effort. We're not where we want to be but the market is eating us up. We are bullish about our future and know that out continued improvement will only serve to better our position as the leader that we are in the web space.
Doug Vann [Drupal Trainer, Consultant, Developer] http://dougvann.com
On the other hand - if this problem could be solved - Drupal become holy grail, which should not exist! :)
The prejudices I have against Drupal are the result of my experience of it starting as far back as version 4. I don't believe they are unfounded.
I'm currently investing moving our sites (a network with 1M+ visits/and 12M+ pageviews) from Drupal 6 to Rails.
We have a large amount of custom code (I've written 20+ modules for this platform), and yet we've gotten to a point where we really want Drupal (and PHP) out of our lives, because it isn't worth the headaches anymore.
When I first started out I actually wasn't using CCK or Views 2, I was creating new node types with a custom module, and if I were to go back to Drupal now I would be sorely tempted to do this again. Views was a bit too fragile and the queries it generated were horrific, and I think if you can code and know PHP and MySQL well they really give you very little value, or possibly even work out slower overall.
Similar comments for Moodle, another popular PHP app. You cannot even change the url for your site without rewriting content in the database.
Thankfully the WP core devs seem to have been slowly cleaning stuff like this up over the last couple years. So even though this wart persists, I have hope it'll eventually get zapped.