For the first time today, I am taking an in-depth look at CiviCRM's API and data model. I must say I'm excited about its direction and the enthusiasm of its supporters, but I'm rather disappointed in some of its underlying principles. I hope I look back on this someday and write myself off as nothing but a grouchy naysayer.
The data model appears to have been copied directly out of the pages of The Data Model Resource Book. I recognized this immediately because I spent hours poring over that book during my '03 Operon coding binge.
Finally peering at the code, I'm reminded of all those starry-eyed college students who wander through our local PHP user groups. Packed full of fresh knowledge, they ramble on about how code should be OOP and how Polymorphism and object state are the only things that validate an application as "enterprise". So, the old-timers say, "OK, but what about performance? What about the practical execution of the shortest path between a and b?".
The kids quickly shrug off these comments: "We're not talking about 'a little bit' of performance", they sneer. "We're talking about extensibility and maintainability".
They'll learn.
Because something isn't extensible or maintainable when the prerequisite to extending it is reading a college text book on esoteric concepts. And something isn't maintainable when you need a 50 page guidebook to determine which file calls what object, which is an extension of whose interface. And by the way, "a little bit" of performance adds up fast.
There are over 70,000 lines of code for just the CiviCRM code itself. While this is a major typing accomplishment, I can only ask if someone should have worked a little smarter and made use of some of that excellent object-oriented reusability.
I would like to have seen CiviCRM be written in a data-oriented manner, not in such a self-involved application oriented manner. By placing all of the importance on all that code and object-oriented beauty, they have abandoned the notion of keeping the data integrity with the data.
The most important thing that a contact application can do is make its data available to other applications. Not through an expensive and marginally useful SOAP interface, but through raw data access. For this, you must include as much structure as possible in the database design. Business rules and validation should be, if at all possible, handled at that layer as well. I'm a big fan of PHP, but I'm not convinced that it should be the only thing that's allowed to have access to your CRM data.
It's impractical to rely on stored procedures when MySQL, the most commonly available open source database, does not have a production-ready version that supports them. But I would like to have seen them lay the groundwork better by focusing on simple, data-oriented procedures rather than investing so much into PHP code.
But the biggest liability for CiviCRM is its license, which prevents people from modifying and distributing derivatives without making the source code available (as does the GPL). Similarly, it prevents someone from creating and hosting derivatives without making the source code available (which the GPL does not cover). This enforces the idea that the GPL is meant to stay free, even in more modern usage contexts. In principle, I agree that this is a great way to go. But I personally feel that removing the ability for additional parties to extend and adapt proprietary extensions of the software will limit its development. A product this complex needs could use more than one full-time organization's input to sustain itself. With high complexity and little documentation, there's not enough cost/benefit to justify making it an integral part of a sustainable business plan. Contrast this with an Apache/BSD style license, which has led to all kinds of corporate support and stable growth.
- Log in to post comments
civicrm response ...
hey vauxia:
interesting comments on civicrm, as one of the developers, here's some comments and feedback:
AGPL Licensing FAQ
Feel free to chime in on the crm-dev list with your comments / critic / questions. Much appreciated, we have ways to go and lots of things to improve on :)
lobo
No offense intended
I'm really surprised anybody reads this! I've never even told anyone about this site and sort of assumed nobody was aware of my ruminations. Silly Google! Now I have to defend myself, and I feel bad that my unedited ramblings from a particularily grouchy moment during a CiviCRM integration are linked from a public mailing list.
I re-read both my comments and yours, and I apologize if I came off harsh or offensive in any way. I was mostly just frustrated because I had high hopes but I felt that CiviCRM seems to have eschewed pragmatic, data-oriented architecture in favor of layer upon layer of abstraction. It adds a substantial performance penalty and creates a barrier for new developers.
Processing power is cheap, but what's often in short supply is volunteer help. If people are frustrated with slow wait times then they'll be less likely to help again. Even for individual use, I feel disinclined to push through the UI to add an action or update information, resorting back to my post-it scribbles. Eventually, I forget to use the tool at all. If a further impediment is multi-user support, such as in a call-center environment, you've made an even bigger tradeoff.
I used to use AGPL on some of my work, and I'm familiar with how it works. I liked that it extends the spirit of the GPL to adapt to internet-based models and non-distributed software. Times were tight, I was small-time, and I was highly concerned about a bigger company stealing my goodies.
But that concern was based on "how big is my slice of pie", not "how big can I make the pie?". I was pretty new at open source, and the decision was based on my own fears that people would take and not give back. No matter what the license, this is bound to happen anyway. I failed to understand that there are positive, non-altruistic benefits to returning code to a project: inviting a broader user base that leads to more support and development of the tool, bug fixes and extensions to your own work, credibility and public recognition of contributions, and so-on.
These benefits make it attractive for third-party developers to build product offerings around a tool, and many changes make it back anyway.
Meanwhile, there are valid reasons for not returning code to a project, including NDA's, integration with other non-free applications, security, industry specificity and the general overhead of managing contributions. For these reasons, parties that might return some but not all of their changes will not participate in a project that requires a full return of contributions.
For a project with relevance to large groups or organizations, I feel that an Apache-style license invites better support avenues. Basically, I feel that CiviCRM should have been clear, simple and lightweight to lower the bar for adoption and extension by a large number of individuals. Or it should have been given a licence that promotes support and extension as a viable business model. Otherwise, I fear that development will be kept to a small number of highly under-appreciated people.
Mostly, I wish to be proven wrong. I was really excited about CiviCRM, and am still excited about the possibilities for such a tool.
licensing and more ...
thanx for the reply :) Apologies for giving your private thoughts additional exposure, but i suspect it was good for the the developers and community to hear different thoughts.
Licensing is a bit like religion, and I suspect we could get into an endless discussion that will not lead anywhere. You do make valid points, and I suspect that if someone does approach us with the issues you raise, we will consider it fairly seriously. I dont think we are very religious about the license. On the other hand the vendor space in non-profit/political advocacy groups is fairly small (relatively speaking). I definitely agree that we do not want licensing to be the barrier for adoption and extension.
I suspect that a large part of the load on an application will be db performance, more than performance imposed by abstraction. I dont have any strong numbers (from CiviCRM) to back me up on this, but we'll be doing some fairly strenous load testing before 1.2 (thanx to a few great users who have shared data sets with us).
Abstraction / OOP vs procedural programming also leads to arguments that go no-where. so i'll avoid commenting on that :)
lobo