Text

SimpleDB is RESTful & Schema-less?

So the big web service of the week announcement goes to Amazon, for their AWS SimpleDB hosted service. This should place nicely with EC2, which is an interesting service except for the fact that persistent data across sessions is problematic (every time you boot an EC2 node it’s a clean slate).

So what is SimpleDB? It’s:

  • Built in Erlang (wow, maybe Erlang is worth learning after all, right?)
  • RESTful; API returns XML
  • Schema-less
  • Non-relational

Wait, what? Schema-less? Non-relational? Yup. In case you haven’t noticed, there’s been a groundswell of interest in this area lately… Perhaps most buzz-worthy is the CouchDB project, which also uses REST for inserts and queries, storing your data in schema-less databases which Amazon confusingly refers to as “domains” (see other differences). CouchDB is pretty neat, and all the cool kids seem to like it. RDDB has similar goals. And then there’s DBSlayer, which takes the approach of wrapping a REST API around traditional relational databases (MySQL, etc).

So why the interest in moving away from traditional RDBMS, which have served us well for so many years? Simplicity. Ease of scaling. The emphasis on removing business logic from the database and keeping it in the application, where it belongs. At least, those are the arguments. I’m no expert, but I’m certainly interested. Assaf Arkin summarizes the argument much better than I can, and his article Read Consistency: Dumb Databases, Smart Services should be required reading for anyone who’s interested in the future of (dumb) databases on the web. Assaf also has a follow-up article on the merits of CouchDB, specifically. There’s a lot to think about here.

Of course, another key value prop with the Amazon service is that it’s hosted. By Amazon. They claim it’s fast and reliable (they should know a thing or two about that), and it looks to be relatively inexpensive, when you consider that the alternative is clustering your own databases for the same kind of speed and reliability. It’ll be interesting to see how this turns out and I’m anxious to play around with it.

All that said, there’s no Ruby library wrapper for SimpleDB yet. However, as Chad Fowler notes, there are already three different projects registered with RubyForge. None of them have checked in even a single file as of this writing, but you know that somebody out there is hard at work (hint hint), and I’m sure you’ll see it before too long. Alternatively, you can build one yourself.

Text

LNUG, Supplement.js, console4worker

LNUG

The London Node.js User Group occurs on the last Wednesday of every month, in Camden. This month’s event is on the 28th of September at 6pm, and has four talks scheduled:

  • Tom Hall – Webscaling With Node.js
  • Andy Kent – Streaming Analytics and Node.js
  • Rob Tweed – The Globals Database: It’s Significance To Developers
  • Garren Smith – These are the ORMs you are looking for

There’s a Google Group for keeping up to date with the group: LNUG Google Group.

Supplement.js

Supplement.js GitHub: olivernn /supplement.js by Oliver Nightingale adds extensions to built-in types:

[Supplement.js is] a small collection of utility functions to make working with JavaScript that much sweeter and more expressive. Responsibly adds extensions to built in types.

There are some nice functional style methods, like Array.prototype.head, Array.prototype.tail, Array.prototype.take, and a lot of functions you probably use from Underscore.js.

The Function extensions are interesting too: Function.prototype.throttle for example returns a function that will only execute once every n milliseconds.

console4Worker

console4Worker GitHub: jeromeetienne /console4Worker by Jerome Etienne helps debug WebWorkers by making console.log (and other console methods) work inside workers in browsers that don’t yet support this.

Some configuration within each worker is required first:

importScripts('console4Worker-worker.js');
console.log("console call made from inside a webworker");

Then on the actual page:

// init the worker
var worker  = new Worker("worker.js");
// bind the console4Worker to get console API from worker
console4Worker.bind(worker);

worker.addEventListener('message', function(event) {
  // filter this event if it is from console4Worker
  if (console4Worker.filterEvent(event)) {
    return;
  }

  // ... here handle your own events
}, false);
Text

WebGL Examples, Backbone Forms, Third-Party JavaScript

WebGL Examples

I found this collection of WebGL examples at ibiblio.org that includes a few things I haven’t seen before, particularly Cycleblob which is an interesting take on the Tron light cycles concept.

Backbone Forms

Backbone Forms by Charles Davison is a form framework for Backbone.js with some advanced features like nested forms, and it even comes with CSS for styling fields.

This library makes it possible to automatically generate forms based on model instances:

var form = new Backbone.Form({
  model: users.get(userId)
}).render();

If a model isn’t available, a Backbone.Form can be instantiated using data and schema properties:

new Backbone.Form({
  data: { id: 123, name: 'Rod Kimble', password: 'cool beans' },
  schema: {
    id:       { type: 'Number' },
    name:     {},
    password: { type: 'Password' }
  }
}).render();

The source is documented and the README has enough examples to get started.

Third-Party JavaScript

Third-Party JavaScript by Ben Vinegar and Anton Kovalyov (both from Disqus) is a book about the art of third-party scripting — writing JavaScript intended to be executed on a remote site. It’s aimed at intermediate developers, and covers distributing and loading applications, server communication, cross-domain iframe messaging, rendering HTML and CSS, authentication, security, and performance. Considering the authors work at Disqus it seems like a potentially essential book on the subject.

The book will be published by Manning, and an “early access” edition can be purchased from $35.99. Three chapters are available so far, and the example source code is on GitHub at benvinegar / thirdpartyjs-code. The first chapter is available for free: Introduction to Third-Party JavaScript (PDF).

To pre-order the book, visit Third-Party JavaScript at Manning’s site.