When your favourite tool is a hammer, everything looks like a nail
Being technical lead isn't as rewarding as I thought it would be. I hate chasing developers when it comes to keeping track on who's working on what. You may argue that this is exactly why they invented bug tracking systems. Well, someone needs to write cases first, and if that's also part of my job then I'm essentially a manager instead of a developer.
I work in a company part-funded by the UK Government. As you can imagine, people tend to take it easy and the lack of project ownership is one of the main reason why I get so frustrated at times. Also, when your line manager is extremely busy and you're left on your own, all the fun of being a technical lead is suddenly gone (if it ever was there in the first place). Some time ago I realized that the team badly needs a project manager; I promptly raised the issue with the head of application development who totally agreed with me and has assured me that this matter is already being looked into. What can I say, maybe they will actually do something about it for a change.
So, following my promotion back in October last year, not only did I give up as much as 50% of the programming work, now I also need to take on new responsibilities of a typical project manager. The only advantage I can possibly see with it is that - in theory - this will look great on my CV at some point.
So what's with the title of this post? For most web development purposes we use Drupal, a rather popular open source content management system. I think it's a great piece of software as not only does it work out of the box, it also comes with a fully working development framework so that both designers and developers can do great things by writing new modules and themes in a relatively short period of time (depending on the requirements of course). So while I think it's a great tool there are times when I look at my company's websites on a technical point of view and I begin to wonder what was the rationale that lead to the adoption of such a software.
A lot has been already said about the advantages of using Drupal in the enterprise. Nevertheless, I argue that because Drupal is a CMS, its adoption should be strictly dependant on the business requirements. Problems with this arise when management is not able to effectively determine what the requirements are.
A new exciting project has just started: the idea is to redesign the entire online presence of the company by redeveloping most websites from scratch whilst enabling data exchange through XML feeds and ideally RESTful web services. So, to answer the question: "Why do you think Drupal is inadequate for this purpose?" Essentially this is because the information architecture dictates that development will be driven by a new application built on top of an Oracle database. Such application already exists and contains millions of records, so why can't we develop additional web services and then build a web application on top of those? I would pick any PHP 5 framework out there for the purpose; considering I have some work experience with the Zend Framework I would probably go ahead with it.
Let me anticipate one of your comments: you could in theory build XML-RPC services with Drupal, right? I'm not sure I want to do that.
Firstly, XML-RPC web services are outdated. While this may sounds like an unreasonable argument I think that as new technology becomes available to use it is certainly worth to evaluate all possibilities. RESTful services are a good example.
Secondly, Drupal doesn't offer solid development tools when it comes to writing data services. Now, that's a strong statement and I'm sure it will sound like a lie to most Drupal advocates. Has anyone ever written web services that were later used as a foundation for a complex web platform? I have and from my experience I can tell you that using Drupal for this purpose is not a good way to go.
Thirdly, I have serious concerns in terms of scalability. The number of queries that Drupal runs for each page served to a browser is ridiculous. Particularly complex data structures can be represented as a node but at a high cost in terms of performance. Opcode caching won't help much with this and the only solution really is to use memcached (or a similar product) as data caching mechanism. As we'll encourage our users to interact with our websites by posting comments, taking surveys and so forth, I assume that the highly efficient page caching mechanism won't be very useful. Partial data caching is possible but rather difficult to implement effectively.
Now that I explained the reasons why I wouldn't use Drupal for the upcoming project I will have to do my very best to prove my point with upper management. Personally I have a feeling I will fail miserably, or maybe someone will do something, for a change.
I'm just wondering what makes
I'm just wondering what makes you think XML-RPC technology is outdated? Especially in comparison with RESTful approach utilizing the very basic concepts behind HTTP itself (which can hardly be considered as new being developed in early nineties). Without any solid arguments it's like debating about superiority of Easter over Christmas, or if rounded corners look cool (hint: they don't.)
The other problem is that XML-RPC is a specification, or a well defined protocol while REST is a development style with no details whatsoever. I can't help thinking XML-RPC protocol can be used as a RESTful service. That may sound a bit silly at first, but my point is as long as one can route the requests the proper way these two can be implemented in a very same (or a very similar at least) manner. Let's have a look at XML-RPC protocol as a RESTful service by following RESTful service constrains:
Client-server architecture - XML-RPC client is independent from the server, a different programming language might be and often is used - checked
Stateless - of course checked
Cacheable - it's extremely easy to cache and manage (revalidate, flush) XML data - checked
Layered system - well, checked
Code on demand - never tried it myself but since I like to be right - checked!
Uniform interface - XML as data transfer layer - CHECKED!
To summarise, even if XML-RPC might not be your best choice, it still can be a valid RESTful service if implemented properly.
As far as I know the RESTful
As far as I know the RESTful architecture was first introduced by Roy Thomas Fielding in his Ph.D. dissertation. What I didn't know was that he wrote it in 2000, quite a while ago. I guess that choosing the best protocol (or rather rules when it comes to REST) is about convenience. Right now I'm particularly thinking of projects such as CouchDB, I'm sure its creators must have had a good reason to build a RESTful interface rather than XML-RPC (or SOAP), perhaps because it was a more convenient choice for them, especially in terms of development. At the same time this makes developers' lives harder when it comes to keep compatibility with earlier versions of a RESTful API. As you said REST is not a protocol therefore you could easily break compatibility although someone might argue that CouchDB is still undergoing heavy development.
Thanks for your comment, you made a very good point.
I forgot to mention one
I forgot to mention one important advantage of RESTful services: it relies heavily on HTTP status codes thus avoiding to parse/process the response's body to find out (for instance) that an error occurred.
Post new comment