Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdew committed Feb 10, 2011
1 parent 6436892 commit e98520b
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 29 deletions.
41 changes: 34 additions & 7 deletions README.md
@@ -1,19 +1,24 @@
BarricaneDB
===========
BarricaneDB - a transparent object persistence mechanism for NodeJS.
====================================================================

Alpha development. Just about works - may contain bugs.
Status v0.2.0 - Just about works - there will be bugs.

BarricaneDB is a loose implementation of the [Prevalence](http://www.ibm.com/developerworks/library/wa-objprev/) System Design Pattern, as implemented in Java by [Prevaylor](http://www.prevayler.org/), but for [NodeJS](http://nodejs.org/).
BarricaneDB is a persistence layer for [NodeJS](http://nodejs.org/) which was developed to meet my following requirements:

* My app's state exists as a heap of objects in RAM. I just want to be able to shutdown my app and get that same heap of objects the next time I start my app.
* I don't want to have to add or change more than a dozen lines of code.
* I want a proper transaction log, so that the data is resilient against application crashes.
* I want to be able to read the transaction log - I care more about making my app easily debuggable than saving disk space.

BarricaneDB is really just an ultra-simple persistance layer for a single process. It can persist your application's model without any explicit 'save' commands. Every Javascript <code>x.y = "foo";</code> (on registered instances) causes asynchronous persistance to disk.
BarricaneDB is a loose implementation of the [Prevalence](http://www.ibm.com/developerworks/library/wa-objprev/) System Design Pattern, as implemented in Java by [Prevaylor](http://www.prevayler.org/), but for [NodeJS](http://nodejs.org/).

Examples
--------
* [example-create-database](http://www.barricane.com/barricane-db/example-create-database.html)
* [example-model](http://www.barricane.com/barricane-db/example-model.html)
* [example-read-database](http://www.barricane.com/barricane-db/example-read-database.html)

There's also full, docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).
There's also docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).

Installation
------------
Expand All @@ -22,7 +27,6 @@ Installation
Reasons why BarricaneDB will never be a good fit for your application.
----------------------------------------------------------------------
* Your data set is too big to fit in RAM.
* Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).
* Your application doesn't happily shard into BarricaneDB's one-DB-per-process design.
* You need to query your database from outside the NodeJS process - e.g. Crystal Reports.

Expand All @@ -32,4 +36,27 @@ Reasons why BarricaneDB is not _currently_ a good fit.
* You need good error handling.
* You need async database opening (persistence is already fully async).
* Transactions are important to you.
* Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).

Backwards compatibility.
------------------------
* We use codecs to separate the data representation from the database.
* All future versions of BarricaneDB will be able to read v0.2.0 <code>.swoj</code> files.

Keep up with BarricaneDB.
-------------------------
* [Watch](https://github.com/chrisdew/barricane-db/toggle_watch) this project on [GitHub](https://github.com/chrisdew/barricane-db).
* Follow the [barricane-db](https://groups.google.com/group/barricane-db) Google Group.
* Look at the documentation on [www.barricane.com](http://www.barricane.com/barricane-db).
* Send me an [email](mailto:cmsdew@gmail.com).
* Follow [chrisdew](http://twitter.com/chrisdew) on Twitter.

Roadmap
-------
* Whether I do anything more to this project, beyond functionality required for some of my other projects, really depends on there being some level of interest in the community. If you want things to happen, please [watch](https://github.com/chrisdew/barricane-db/toggle_watch) this project on [GitHub](https://github.com/chrisdew/barricane-db) and subscribe to the [Google Group](https://groups.google.com/group/barricane-db).
* Some of the features I'd like to add include:
# Change the DB to an emitter and make the open async.
# Create a subscribe facility so that webclient-proxy objects can be notified on changes to objects which are displayed on user's browsers.
# Create a more efficient delta-codec which only logs the changed fields of registered instances.
# Add ACID transactions.
* Anything you'd like to add? - Create an issue on GitHub.
49 changes: 42 additions & 7 deletions docs/barricane-db.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/db.html
Expand Up @@ -89,4 +89,4 @@
<span class="k">this</span><span class="p">.</span><span class="nx">io</span><span class="p">.</span><span class="nx">end</span><span class="p">(</span><span class="nx">callback</span><span class="p">);</span>
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <p>Export the symbols.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">DB</span> <span class="o">=</span> <span class="nx">DB</span><span class="p">;</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
2 changes: 1 addition & 1 deletion docs/disk-io.html
Expand Up @@ -90,4 +90,4 @@
<span class="k">this</span><span class="p">.</span><span class="nx">ending</span> <span class="o">=</span> <span class="nx">callback</span><span class="p">;</span>
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>Export the symbols.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">DiskIO</span> <span class="o">=</span> <span class="nx">DiskIO</span><span class="p">;</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
2 changes: 1 addition & 1 deletion docs/example-create-database.html
Expand Up @@ -22,4 +22,4 @@
<span class="p">}</span>
<span class="p">});</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
2 changes: 1 addition & 1 deletion docs/example-model.html
Expand Up @@ -16,4 +16,4 @@
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Export the symbols.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">House</span> <span class="o">=</span> <span class="nx">House</span><span class="p">;</span>
<span class="nx">exports</span><span class="p">.</span><span class="nx">Person</span> <span class="o">=</span> <span class="nx">Person</span><span class="p">;</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
2 changes: 1 addition & 1 deletion docs/example-read-database.html
Expand Up @@ -27,4 +27,4 @@
<span class="p">}</span>
<span class="p">});</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
2 changes: 1 addition & 1 deletion docs/swoj-codec.html
Expand Up @@ -76,4 +76,4 @@
<span class="p">});</span>
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Anonomise the exported name, so that codecs can be used interchangeably, </p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">Codec</span> <span class="o">=</span> <span class="nx">SwojCodec</span><span class="p">;</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
2 changes: 1 addition & 1 deletion docs/util.html
Expand Up @@ -22,4 +22,4 @@
<span class="p">}</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Export the functions.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">.</span><span class="nx">ownKeys</span> <span class="o">=</span> <span class="nx">ownKeys</span>
<span class="nx">exports</span><span class="p">.</span><span class="nx">ownRealKeys</span> <span class="o">=</span> <span class="nx">ownRealKeys</span>

</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
</pre></div> </td> </tr> </tbody> </table> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-732703-12']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
41 changes: 34 additions & 7 deletions lib/barricane-db.js
@@ -1,22 +1,27 @@
// Copyright (c) 2010 Barricane Technology Ltd., All Rights Reserved.
// Released under the MIT open source licence.

// BarricaneDB
// ===========
// BarricaneDB - a transparent object persistence mechanism for NodeJS.
// ====================================================================

// Alpha development. Just about works - may contain bugs.
// Status v0.2.0 - Just about works - there will be bugs.

// BarricaneDB is a loose implementation of the [Prevalence](http://www.ibm.com/developerworks/library/wa-objprev/) System Design Pattern, as implemented in Java by [Prevaylor](http://www.prevayler.org/), but for [NodeJS](http://nodejs.org/).
// BarricaneDB is a persistence layer for [NodeJS](http://nodejs.org/) which was developed to meet my following requirements:

// * My app's state exists as a heap of objects in RAM. I just want to be able to shutdown my app and get that same heap of objects the next time I start my app.
// * I don't want to have to add or change more than a dozen lines of code.
// * I want a proper transaction log, so that the data is resilient against application crashes.
// * I want to be able to read the transaction log - I care more about making my app easily debuggable than saving disk space.

// BarricaneDB is really just an ultra-simple persistance layer for a single process. It can persist your application's model without any explicit 'save' commands. Every Javascript <code>x.y = "foo";</code> (on registered instances) causes asynchronous persistance to disk.
// BarricaneDB is a loose implementation of the [Prevalence](http://www.ibm.com/developerworks/library/wa-objprev/) System Design Pattern, as implemented in Java by [Prevaylor](http://www.prevayler.org/), but for [NodeJS](http://nodejs.org/).

// Examples
// --------
// * [example-create-database](http://www.barricane.com/barricane-db/example-create-database.html)
// * [example-model](http://www.barricane.com/barricane-db/example-model.html)
// * [example-read-database](http://www.barricane.com/barricane-db/example-read-database.html)

// There's also full, docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).
// There's also docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).

// Installation
// ------------
Expand All @@ -25,7 +30,6 @@
// Reasons why BarricaneDB will never be a good fit for your application.
// ----------------------------------------------------------------------
// * Your data set is too big to fit in RAM.
// * Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).
// * Your application doesn't happily shard into BarricaneDB's one-DB-per-process design.
// * You need to query your database from outside the NodeJS process - e.g. Crystal Reports.

Expand All @@ -35,7 +39,30 @@
// * You need good error handling.
// * You need async database opening (persistence is already fully async).
// * Transactions are important to you.
// * Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).

// Backwards compatibility.
// ------------------------
// * We use codecs to separate the data representation from the database.
// * All future versions of BarricaneDB will be able to read v0.2.0 <code>.swoj</code> files.

// Keep up with BarricaneDB.
// -------------------------
// * [Watch](https://github.com/chrisdew/barricane-db/toggle_watch) this project on [GitHub](https://github.com/chrisdew/barricane-db).
// * Follow the [barricane-db](https://groups.google.com/group/barricane-db) Google Group.
// * Look at the documentation on [www.barricane.com](http://www.barricane.com/barricane-db).
// * Send me an [email](mailto:cmsdew@gmail.com).
// * Follow [chrisdew](http://twitter.com/chrisdew) on Twitter.

// Roadmap
// -------
// * Whether I do anything more to this project, beyond functionality required for some of my other projects, really depends on there being some level of interest in the community. If you want things to happen, please [watch](https://github.com/chrisdew/barricane-db/toggle_watch) this project on [GitHub](https://github.com/chrisdew/barricane-db) and subscribe to the [Google Group](https://groups.google.com/group/barricane-db).
// * Some of the features I'd like to add include:
// # Change the DB to an emitter and make the open async.
// # Create a subscribe facility so that webclient-proxy objects can be notified on changes to objects which are displayed on user's browsers.
// # Create a more efficient delta-codec which only logs the changed fields of registered instances.
// # Add ACID transactions.
// * Anything you'd like to add? - Create an issue on GitHub.

// This file is the entry point for the NPM barricane-db package.
// It only exports symbols required from other modules.
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{ "name" : "barricane-db"
, "description" : "A NodeJS-based in-process database."
, "version" : "0.0.1"
, "version" : "0.2.0"
, "maintainers" :
[ { "name": "Chris Dew"
, "email": "cmsdew@gmail.com"
Expand Down

0 comments on commit e98520b

Please sign in to comment.