Tuesday, May 13th, 2008

Persevere: JSON Storage / Application Server

Category: Dojo, JSON, Showcase

Kris Zyp of Sitepen has released Persevere:

An open source set of tools for persistence and distributed computing using intuitive standards-based JSON interfaces of HTTP REST, JSON-RPC, JSONPath, and HTTP Channels. The core of the Persevere project is the Persevere Server. The Persevere server includes a Persevere JavaScript client, but the standards-based interface is intended to be used with any framework or client.

The Persevere Server is an object storage engine and application server
(running on Java/Rhino) that provides persistent data storage of dynamic
JSON data in an interactive server side JavaScript environment. It is
currently in beta, and boasts a very solid feature set that should
interest JavaScript, Dojo and Ajax developers:

  • Create, read, update, and delete access to persistent data through
    a standard JSON HTTP/REST web interface
  • Dynamic object persistence – expando objects, arrays, and
    JavaScript functions can be stored, for extensive JavaScript persistence
  • Remote execution of JavaScript methods on the server through
    JSON-RPC for a consistent client/server language platform
  • Flexible and fast indexed query capability through JSONPath
  • Comet-based data monitoring capabilities through HTTP Channels
    with Bayeux transport plugin/negotiation support
  • Data-centric capability-based object level security with user
    management, Persevere is designed to be accessed securely through Ajax
    with public-facing sites
  • Comprehensive referencing capabilities using JSON referencing,
    including circular, multiple, lazy, non-lazy, cross-data source, and
    cross-site referencing for a wide variety of object structures
  • Data integrity and validation through JSON Schema
  • Class-based data hierarchy – typed objects can have methods,
    inheritance, class-based querying
  • Pluggable data source architectures – SQL tables, XML files,
    remote web services can be used as data stores
  • Service discovery through Service Mapping Description

You can check out a live Persevere data grid demo that auto-syncs the grid using JS such as this:


  1. var persevereStores = dojox.data.PersevereStore.getStores(); // persevere stores are auto-generated
  2. customerStore = persevereStores.Customer; // and get the Customer store
  3. dataModel = new dojox.grid._data.DojoData(null,null,{/*rowsPerPage:12,*/store:customerStore,query:"",clientSort:true});
  5. addItem = function() {
  6.     // need to specify the parent because the customerStore is hierarchical and the grid model will
  7.     // call newItem without any info who the parent
  8.     //customerStore.parentId="0.examples.customers";
  9.     grid.addRow({firstName: "firstName", lastName: "lastName",created:dojo.date.stamp.toISOString(new Date,{zulu:true})});
  10. }

Posted by Dion Almaer at 3:46 am

3.7 rating from 33 votes


Comments feed TrackBack URI

I wanted to like this, but….

The page fails miserably in IE6 (eg. ‘this.model.fields is null or not an object’) and just doesn’t render.

In FF2, the grid is horrible – it’s rendering is slow and ugly and it fails to scroll horizontally at all, also editing cell content is hit and miss.

On top of this, when you are able to make changes I see no updates in the other window even when I hit the grid refresh button.

This may be unfair to persevere as they are probably issues with the dojo widgets, but – YUK!

Not being a Dojo user, I would certainly never consider dojo based on these first impressions (not a patch on YUI or Ext JS).

Comment by danh2000 — May 13, 2008

@danh2000 – My apologies, I don’t think the grid was really intended to be used for a constantly growing number of columns with my simple naive layout. I wanted to include the add property so people could see the dynamic nature of the database, but that obviously backfired with the large number of people creating new properties and making the grid have a ridiculously large number of columns. Typically the grid is used with a fixed set of columns that can be properly styled and visually dialed in. The Dojo grid looks great in these situations, and has extremely powerful vertical scrolling capabilities. I also should have compressed/packaged up the CSS as well, this would substantially improved load time. As far as errors in IE6, I mainly tested in FF2, IE8, and Safari, so it is my fault that I missed that error. I will see if I can find a machine (or VM) to test IE6, although that particular error is usually when the server is down or network error, perhaps it could have been a network glitch?
Anyway, my apologies for these problems and my misuse of the Dojo widgets. I think you should definitely take another look at Dojo, the widgets really are fantastic when used sensibly, and this combined with an infrastructure that lets you plug in network driven data stores right into widgets is a very powerful.

Comment by kriszyp — May 14, 2008

I really enjoyed reading about this…

The first time

No slight Kris, I was massively impressed the first time. ;)

Comment by rektide — May 15, 2008

@rektide, Persevere has been available for a while now, but we announced that it is now a SitePen project and that it now has Comet support. Ajaxian picked up the story and we didn’t complain. There has been a lot of new features and changes since that last post.

Comment by kriszyp — May 16, 2008

Leave a comment

You must be logged in to post a comment.