Doozer: consistent distributed data store written in Go

Doozer logo

This looks interesting. At work we use a VIP to control which machines are in the live group and which are in the dark (standby) group. We used to use DNS, but the propagation delay caused issues, especially if we needed to roll back a change.

From the Doozer Github Repo:

Doozer is a highly-available, completely consistent store for small amounts of extremely important data. When the data changes, it can notify
connected clients immediately (no polling), making it ideal for infrequently-updated data for which clients want real-time updates. Doozer is good
for name service, database master elections, and configuration data shared between several machines.

Webview Screenshot from Doozer Github page

YDN-DB: HTML5 Javascript database library for IndexedDB

yathit logo

OK. So I’m not even gonna lie. I had no idea what IndexedDB was before I came across YDN-DB. I’ve only dabbled with serious JavaScript development so far, and the framework-soup that has arisen in the space rivals Java at this point.

Anyway, on to the website!

YDN-DB is a pure javascript library, which uses HTML5 browser database sunch as IndexedDB, WebDatabase (WebSQL) and WebStorage (localStorage). Most
modern browsers including IE10, Chrome, Firefox and Safari support either IndexedDB or WebSQL. The library can also be used in web client such as
phonegap, WebView and UIWebView mobile clients.

Supports:

  • Chrome 4+ (IndexedDB or WebSql)
  • Firefox 3+ (IndexedDB draft), Firefox 10+ (IndexedDB)
  • IE 6 (userdata), IE7+ (localStorage), IE10+ desktop/mobile (IndexedDB)
  • Safari 3.1+ desktop/mobile/iOS web client (WebSql)
  • Android web client, Android browser 2.1+ (WebSql), 4+ (IndexedDB)
  • Opera 10+ (WebSql), Opera 15+ (IndexedDB)

Code snippets:

var db = new ydn.db.Storage('db-name');
db.put('store-name', {message: 'Hello world!'}, 'id1');
db.get('store-name', 'id1').always(function(record) {
  console.log(record);
});

Indexed Queries

var q = db.from('people').where('age', '>=', 25);
q.list(10).done(function(peoples) {
  console.log(peoples); // list of first 10 peoples
});

var q = db.from('people').where('country', '=', 'US').order('name');
q.list(10).done(function(peoples) {
  console.log(peoples); // list of first 10 peoples from US ordered by name
});
q.list(10).done(function(peoples) {
  console.log(peoples); // next 10 peoples
});

Streaming API for reduced memory usage

var q = db.from('author').where('first', 'starts', input_value);
var ul = document.getElementById('auto-suggestion-list');
ul.innerHTML = '';
q.open(function (cursor) {
  var li = document.createElement('li');
  var people = cursor.getValue();
  li.textContent = people.first + ' ' + people.last;
});

Synchronize with REST backend services

var schema = {
  stores: [{
        name: 'todo',
        keyPath: 'id',
        Sync: {
          format: 'gcs',  // Google Cloud Storage
          Options: {
            bucket: 'ydn-note-data',
            prefix: 'todo/'
          }
        }
  }]
};
var db = new ydn.db.Storage(db_name, schema);
// GET https://ydn-note-data.storage.googleapis.com/todo/id123
db.get('todo', 'id123');
// PUT https://ydn-note-data.storage.googleapis.com/todo/id123
db.put('todo', 'id123');
// DELETE https://ydn-note-data.storage.googleapis.com/todo/id123
db.remove('todo', 'id123');

SQLAlchemy: Python SQL Toolkit and Object Relational Mapper

SQLAlchemy masthead from site

SQLAlchemy looks cool enough to make me go hunting for a Java equivalent for use on projects at work.

Take a look at the features page. I’m particularly interested in the Unit Of Work

The Unit Of Work system, a central part of SQLAlchemy’s Object Relational Mapper (ORM), organizes pending insert/update/delete operations into
queues and flushes them all in one batch. To accomplish this it performs a topological “dependency sort” of all modified items in the queue so as
to honor inter-row dependencies, and groups redundant statements together where they can sometimes be batched even further. This produces the
maximum efficiency and transaction safety, and minimizes chances of deadlocks. Modeled after Fowler’s “Unit of Work” pattern as well as
Hibernate, Java’s leading object-relational mapper.

…and Raw SQL statement mapping

SQLA’s object relational query facilities can accommodate raw SQL statements as well as plain result sets, and object instances can be generated
from these results in the same manner as any other ORM operation. Any hyper-optimized query that you or your DBA can cook up, you can run in
SQLAlchemy, and as long as it returns the expected columns within a rowset, you can get your objects from it. Statements which represent multiple
kinds of objects can be used as well, with results received as named-tuples, or with dependent objects routed into collections on parent objects.

SQLAlchemy supports…

…dialects for SQLite, Postgresql, MySQL, Oracle, MS-SQL, Firebird, Sybase and others, most of which support multiple DBAPIs. Other dialects are
published as external projects. The corresponding DB-API 2.0 implementation (or sometimes one of several available) is required to use each
particular database. View Current DBAPI Support.

Bruce Eckel is a Java guy I respect. He wrote Thinking in Java and he said this about SQLAlchemy:

SQLAlchemy is a pretty amazing design…In SQLAlchemy, you need to explicitly start a session. What’s amazing is that all the changes you make
during that session are kept in some kind of parse tree, and then when the session ends SQL is created on-the-fly to produce a single, optimal
SQL statement for that particular sequence of changes. I found this idea pretty mind-blowing.

That sounds pretty sexy to me.