JCR in 15 minutes

November 3, 2009

We had a great NoSQL meeting yesterday evening colocated with ApacheCon. Thanks Jukka for organizing!

I was in track B for the second part, and found it very interesting to compare three different approaches to non-relational content storage: MarkLogic server, JCR and Pier Fumagalli’s Lucene+DAV technique.

I also quite liked Steve Yen’s “horseless carriage” way of looking at NoSQL. Defining things by what they are, as opposed to what they are not, sounds like a good idea.

I gave a short talk about JCR, find the slides below. Of course, as usual, they’re not as good as when I’m here to talk about them ;-)

CMIS could be the MIDI interface of content management…

April 28, 2009

MIDI – the Musical Instrument Digital Interface – was created back in 1982 by a consortium of musical equipment manufacturers including, if I remember correctly, Roland, Yamaha, Sequential Circuits, Korg, Oberheim (I’ve got a Matrix 6 to sell BTW ;-), maybe Ensoniq (did they exist already?) and others. Companies that were fiercely competing in the market, individualistic industry leaders who agreed to get together to create a bigger market for their instruments and equipment.

My diploma work as an electronics engineer was about MIDI, in 1983 – I created a MIDI output interface that could be retrofitted into accordions. The spec was not final at the time (or at least I could get a final version – that was before the web of course), all I had in terms of specs were a few magazine articles, a Yamaha DX7 and one of the first Korg synths to have MIDI. Both synths had slightly different implementations, and some compatibility problems, as can be expected from an early and not yet widespread spec.

What’s happening with CMIS today sounds quite similar: competing vendors finally agreeing on an interoperability spec, even if it’s limited to a lowest common denominator. If this works as with MIDI, we’re in for some exciting times – the few years after 1982 saw a boom in MIDI-related electronic instruments and systems, as suddenly all kinds of equipment from different companies could talk together.

MIDI had serious shortcomings: a slow transmission rate, serial transmission meaning each note in a thick chord is delayed by nearly one millisecond, and somewhat limited data ranges for some real-time controllers. But the basic idea was great, let’s get something done that allows our instruments to talk together in a usable fashion, even if it’s not perfect. MIDI has survived until today, 27 years later, which is quite amazing for such a standard. It’s been tweaked and workarounds (including hardware extensions) have been used to adapt it to evolving needs, and often travels via USB or other fast channels today, but it’s still here, and the impact on the music equipment industry is still visible.

I must admit that I was quite disappointed with the CMIS spec when I first looked at it, especially due to the so-called REST bindings which aren’t too RESTful. And CMIS seems to consider a “document” as the unit of content, whereas JCR converts like myself prefer to work at a more atomic level. And don’t tell me that hierachies are a bad thing in managing content – you might want to ignore them in some cases, but micro-trees are a great way of organizing atoms of content.

Nevertheless, seeing the enthusiasm around the soon-to-be-incubating Apache Chemistry project (that link should work in a few days, how’s that for buzz building?) made me think about MIDI, and how amazing it was at the time that “commercial enemies” could get together to do something that finally benefitted the whole industry.

I still don’t understand why WebDAV can’t do the job if this is about documents, and still prefer JCR for actual work with content (considering that everything is content), but I’m starting to think that CMIS might make a big difference. It will need a test suite for that of course- software engineers know that interoperability without test suites can’t work – and this week’s CMIS plugfest is a good step in this direction. I’ll be around on Thursday, looking forward to it!

Oracle buys MySQL (as part of Sun) – a great time to have another look at content repositories!

April 20, 2009

Lots of noise (and some gems) about the acquisition of Sun by Oracle on Twitter today. But contrary to Oracle’s content servers, Twitter seems to be holding up quite well.

I half-jokingly added my own noise saying that now’s a good time for people worried about MySQL’s future to switch to JCR, and Bergie agrees!

Rereading this post, what follows sounds a bit like marketingspeak, but it’s not – just enthusiasm!

We’ve been discussing the similarities between Midgard and JCR earlier this year with him and also with Jukka, and it’s amazing to see how close the models of Midgard and JCR are. With their TYPO3CR, Typo3 also agree that the JCR model is extremely well suited for content storage and manipulation. Midgard2 doesn’t use the JCR APIs, but as mentioned above the concepts are very similar.

Having made the move myself from wire-some-object-relational-stuff-on-top-of-sql-and-suffer-forever to JCR as an API that’s designed from the ground up to work with granular content, including observation, unstructured nodes and many other nice features, I’m not going back!

If you’re working with content (and yes, everything is content anyway), and started wondering about the future of MySQL today, now might be a good time to take another look at JCR. Apache Jackrabbit has been making huge progress in the last two years with respect to performance and reliability, and Apache Sling makes it much easier than before to get started with JCR, mostly due to its HTTP/JSON storage and query interface which takes the J out of JCR.

Never had so many (meaningful) replies and retweets on Twitter before today – but I started by wondering why CMIS wants to reinvent WebDAV, so no wonder. We’ll save that one for another time I guess.

Using the JCR-Explorer with Sling

January 6, 2009

jcr-explorer-with-sling-200.jpgHere’s how to configure the JCR-Explorer tool under Tomcat, to use it with Sling.

Tested with Tomcat 6.0.18, JDK 1.5 and the Sling launchpad/webapp from revision 731934.

Starting with a fresh Tomcat install, add this to conf/server.xml, inside <GlobalNamingResources>:

<Resource name="jcr/globalRepository"

Add this to conf/context.xml, inside <Context>:

<ResourceLink name="jcr/repository"

Copy the jcr-explorer.war file to the tomcat webapps folder, start tomcat,
stop it (so that the webapp is expanded) and add this at the end of webapps/jcr-explorer/WEB-INF/web.xml, inside <web-app>:

<ResourceLink name="jcr/repository"

Copy these two jar files to the lib folder (or common/lib for Tomcat 5):
jackrabbit-jcr-rmi-1.5.0.jar and jcr-1.0.jar.

Start Sling with the RMI export of the repository enabled. That’s standard if you start the Sling launchpad/webapp module with mvn jetty:run, for example. Sling can either run inside Tomcat, or standalone, as the connection is made via RMI.

On the jcr-explorer login page (http://localhost:8080/jcr-explorer/login.jsf), use java:comp/env/jcr/repository as the JNDI URL, and admin/admin for login and password.

You should now see the JCR-Explorer page, as in our screenshot, displaying the contents of the Sling repository in the left pane (index.html, sling-logo.png, etc.).

This JCR-Explorer setup can be used to access any Jackrabbit repository accessible via rmi://, that should work with plain Jackrabbit setups as well, of course.

See the JCR-Explorer website for more info about how to use that tool.

A Sling-based blog in 46 lines of code

December 15, 2008

That’s the topic of my first post at dev.day.com. It’s a simple introduction to the “take the J out of JCR” Sling features.

Jackrabbit 1.5 release, with standalone runnable jar

December 8, 2008

jackrabbit-1-5-webapp.jpgCongrats to the Jackrabbit team on their 1.5 release!

One of the nice things in this release is the standalone server jar:

$ java -jar jackrabbit-standalone-1.5.0.jar 
Welcome to Apache Jackrabbit!
Using repository directory jackrabbit
Writing log messages to jackrabbit/log
Starting the server...
Apache Jackrabbit is now running at http://localhost:8080/

Makes it much easier to get started, and the http://localhost:8080/ page contains or points to the necessary info to get further. I cannot help mentioning Sling as another good choice to get started with JCR, but if you’re after raw JCR, the Jackrabbit standalone server is very helpful.

Update: Jukka has more details on the most important changes.

JCR community meetup, Amsterdam, April 8th

March 27, 2008

A JCR community meetup is being organized as a sidetrack of ApacheCon Europe 2008.

If you’re intersted, see the wiki page for signup and topics, or talk to us on the Jackrabbit or Sling mailing lists.