Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

v0.2.0

  • Loading branch information...
commit e98520b56a25ccf8599b90492f219776977e6b2f 1 parent 6436892
chrisdew authored
41 README.md
Source Rendered
... ... @@ -1,11 +1,16 @@
1   -BarricaneDB
2   -===========
  1 +BarricaneDB - a transparent object persistence mechanism for NodeJS.
  2 +====================================================================
3 3
4   -Alpha development. Just about works - may contain bugs.
  4 +Status v0.2.0 - Just about works - there will be bugs.
5 5
6   -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/).
  6 +BarricaneDB is a persistence layer for [NodeJS](http://nodejs.org/) which was developed to meet my following requirements:
  7 +
  8 +* 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.
  9 +* I don't want to have to add or change more than a dozen lines of code.
  10 +* I want a proper transaction log, so that the data is resilient against application crashes.
  11 +* I want to be able to read the transaction log - I care more about making my app easily debuggable than saving disk space.
7 12
8   -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.
  13 +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/).
9 14
10 15 Examples
11 16 --------
@@ -13,7 +18,7 @@ Examples
13 18 * [example-model](http://www.barricane.com/barricane-db/example-model.html)
14 19 * [example-read-database](http://www.barricane.com/barricane-db/example-read-database.html)
15 20
16   -There's also full, docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).
  21 +There's also docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).
17 22
18 23 Installation
19 24 ------------
@@ -22,7 +27,6 @@ Installation
22 27 Reasons why BarricaneDB will never be a good fit for your application.
23 28 ----------------------------------------------------------------------
24 29 * Your data set is too big to fit in RAM.
25   -* Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).
26 30 * Your application doesn't happily shard into BarricaneDB's one-DB-per-process design.
27 31 * You need to query your database from outside the NodeJS process - e.g. Crystal Reports.
28 32
@@ -32,4 +36,27 @@ Reasons why BarricaneDB is not _currently_ a good fit.
32 36 * You need good error handling.
33 37 * You need async database opening (persistence is already fully async).
34 38 * Transactions are important to you.
  39 +* Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).
35 40
  41 +Backwards compatibility.
  42 +------------------------
  43 +* We use codecs to separate the data representation from the database.
  44 +* All future versions of BarricaneDB will be able to read v0.2.0 <code>.swoj</code> files.
  45 +
  46 +Keep up with BarricaneDB.
  47 +-------------------------
  48 +* [Watch](https://github.com/chrisdew/barricane-db/toggle_watch) this project on [GitHub](https://github.com/chrisdew/barricane-db).
  49 +* Follow the [barricane-db](https://groups.google.com/group/barricane-db) Google Group.
  50 +* Look at the documentation on [www.barricane.com](http://www.barricane.com/barricane-db).
  51 +* Send me an [email](mailto:cmsdew@gmail.com).
  52 +* Follow [chrisdew](http://twitter.com/chrisdew) on Twitter.
  53 +
  54 +Roadmap
  55 +-------
  56 +* 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).
  57 +* Some of the features I'd like to add include:
  58 +# Change the DB to an emitter and make the open async.
  59 +# Create a subscribe facility so that webclient-proxy objects can be notified on changes to objects which are displayed on user's browsers.
  60 +# Create a more efficient delta-codec which only logs the changed fields of registered instances.
  61 +# Add ACID transactions.
  62 +* Anything you'd like to add? - Create an issue on GitHub.
49 docs/barricane-db.html
... ... @@ -1,30 +1,65 @@
1 1 <!DOCTYPE html> <html> <head> <title>barricane-db.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="example-create-database.html"> example-create-database.js </a> <a class="source" href="example-model.html"> example-model.js </a> <a class="source" href="example-read-database.html"> example-read-database.js </a> <a class="source" href="barricane-db.html"> barricane-db.js </a> <a class="source" href="db.html"> db.js </a> <a class="source" href="disk-io.html"> disk-io.js </a> <a class="source" href="swoj-codec.html"> swoj-codec.js </a> <a class="source" href="util.html"> util.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> barricane-db.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Copyright (c) 2010 Barricane Technology Ltd., All Rights Reserved.
2   -Released under the MIT open source licence.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h1>BarricaneDB</h1> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Alpha development. Just about works - may contain bugs.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>BarricaneDB is a loose implementation of the <a href="http://www.ibm.com/developerworks/library/wa-objprev/">Prevalence</a> System Design Pattern, as implemented in Java by <a href="http://www.prevayler.org/">Prevaylor</a>, but for <a href="http://nodejs.org/">NodeJS</a>.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>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.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>Examples</h2>
  2 +Released under the MIT open source licence.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <h1>BarricaneDB - a transparent object persistence mechanism for NodeJS.</h1> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Status v0.2.0 - Just about works - there will be bugs.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>BarricaneDB is a persistence layer for <a href="http://nodejs.org/">NodeJS</a> which was developed to meet my following requirements:</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <ul>
  3 +<li>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.</li>
  4 +<li>I don't want to have to add or change more than a dozen lines of code.</li>
  5 +<li>I want a proper transaction log, so that the data is resilient against application crashes.</li>
  6 +<li>I want to be able to read the transaction log - I care more about making my app easily debuggable than saving disk space.</li>
  7 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>BarricaneDB is a loose implementation of the <a href="http://www.ibm.com/developerworks/library/wa-objprev/">Prevalence</a> System Design Pattern, as implemented in Java by <a href="http://www.prevayler.org/">Prevaylor</a>, but for <a href="http://nodejs.org/">NodeJS</a>.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h2>Examples</h2>
3 8
4 9 <ul>
5 10 <li><a href="http://www.barricane.com/barricane-db/example-create-database.html">example-create-database</a> </li>
6 11 <li><a href="http://www.barricane.com/barricane-db/example-model.html">example-model</a> </li>
7 12 <li><a href="http://www.barricane.com/barricane-db/example-read-database.html">example-read-database</a> </li>
8   -</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>There's also full, docco-generated, documentation online at <a href="http://www.barricane.com/barricane-db/">http://www.barricane.com/barricane-db/</a>.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <h2>Installation</h2>
  13 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>There's also docco-generated, documentation online at <a href="http://www.barricane.com/barricane-db/">http://www.barricane.com/barricane-db/</a>.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <h2>Installation</h2>
9 14
10 15 <ul>
11 16 <li><code>npm install barricane-db</code></li>
12   -</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <h2>Reasons why BarricaneDB will never be a good fit for your application.</h2>
  17 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <h2>Reasons why BarricaneDB will never be a good fit for your application.</h2>
13 18
14 19 <ul>
15 20 <li>Your data set is too big to fit in RAM.</li>
16   -<li>Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).</li>
17 21 <li>Your application doesn't happily shard into BarricaneDB's one-DB-per-process design.</li>
18 22 <li>You need to query your database from outside the NodeJS process - e.g. Crystal Reports.</li>
19   -</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <h2>Reasons why BarricaneDB is not <em>currently</em> a good fit.</h2>
  23 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <h2>Reasons why BarricaneDB is not <em>currently</em> a good fit.</h2>
20 24
21 25 <ul>
22 26 <li>Your application needs a production-tested solution.</li>
23 27 <li>You need good error handling.</li>
24 28 <li>You need async database opening (persistence is already fully async).</li>
25 29 <li>Transactions are important to you.</li>
26   -</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>This file is the entry point for the NPM barricane-db package.
  30 +<li>Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).</li>
  31 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <h2>Backwards compatibility.</h2>
  32 +
  33 +<ul>
  34 +<li>We use codecs to separate the data representation from the database.</li>
  35 +<li>All future versions of BarricaneDB will be able to read v0.2.0 <code>.swoj</code> files.</li>
  36 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <h2>Keep up with BarricaneDB.</h2>
  37 +
  38 +<ul>
  39 +<li><a href="https://github.com/chrisdew/barricane-db/toggle_watch">Watch</a> this project on <a href="https://github.com/chrisdew/barricane-db">GitHub</a>.</li>
  40 +<li>Follow the <a href="https://groups.google.com/group/barricane-db">barricane-db</a> Google Group.</li>
  41 +<li>Look at the documentation on <a href="http://www.barricane.com/barricane-db">www.barricane.com</a>.</li>
  42 +<li>Send me an <a href="mailto:cmsdew@gmail.com">email</a>.</li>
  43 +<li>Follow <a href="http://twitter.com/chrisdew">chrisdew</a> on Twitter.</li>
  44 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <h2>Roadmap</h2>
  45 +
  46 +<ul>
  47 +<li>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 <a href="https://github.com/chrisdew/barricane-db/toggle_watch">watch</a> this project on <a href="https://github.com/chrisdew/barricane-db">GitHub</a> and subscribe to the <a href="https://groups.google.com/group/barricane-db">Google Group</a>.</li>
  48 +<li>Some of the features I'd like to add include:</li>
  49 +</ul>
  50 +
  51 +<h1>Change the DB to an emitter and make the open async.</h1>
  52 +
  53 +<h1>Create a subscribe facility so that webclient-proxy objects can be notified on changes to objects which are displayed on user's browsers.</h1>
  54 +
  55 +<h1>Create a more efficient delta-codec which only logs the changed fields of registered instances.</h1>
  56 +
  57 +<h1>Add ACID transactions.</h1>
  58 +
  59 +<ul>
  60 +<li>Anything you'd like to add? - Create an issue on GitHub.</li>
  61 +</ul> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>This file is the entry point for the NPM barricane-db package.
27 62 It only exports symbols required from other modules.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">bdb</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;./db&#39;</span><span class="p">);</span>
28 63 <span class="nx">exports</span><span class="p">.</span><span class="nx">DB</span> <span class="o">=</span> <span class="nx">bdb</span><span class="p">.</span><span class="nx">DB</span><span class="p">;</span>
29 64
30   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  65 +</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  docs/db.html
@@ -89,4 +89,4 @@
89 89 <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>
90 90 <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>
91 91
92   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  92 +</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  docs/disk-io.html
@@ -90,4 +90,4 @@
90 90 <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>
91 91 <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>
92 92
93   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  93 +</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  docs/example-create-database.html
@@ -22,4 +22,4 @@
22 22 <span class="p">}</span>
23 23 <span class="p">});</span>
24 24
25   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  25 +</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  docs/example-model.html
@@ -16,4 +16,4 @@
16 16 <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>
17 17 <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>
18 18
19   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  19 +</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  docs/example-read-database.html
@@ -27,4 +27,4 @@
27 27 <span class="p">}</span>
28 28 <span class="p">});</span>
29 29
30   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  30 +</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  docs/swoj-codec.html
@@ -76,4 +76,4 @@
76 76 <span class="p">});</span>
77 77 <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>
78 78
79   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  79 +</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  docs/util.html
@@ -22,4 +22,4 @@
22 22 <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>
23 23 <span class="nx">exports</span><span class="p">.</span><span class="nx">ownRealKeys</span> <span class="o">=</span> <span class="nx">ownRealKeys</span>
24 24
25   -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
  25 +</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 lib/barricane-db.js
... ... @@ -1,14 +1,19 @@
1 1 // Copyright (c) 2010 Barricane Technology Ltd., All Rights Reserved.
2 2 // Released under the MIT open source licence.
3 3
4   -// BarricaneDB
5   -// ===========
  4 +// BarricaneDB - a transparent object persistence mechanism for NodeJS.
  5 +// ====================================================================
6 6
7   -// Alpha development. Just about works - may contain bugs.
  7 +// Status v0.2.0 - Just about works - there will be bugs.
8 8
9   -// 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/).
  9 +// BarricaneDB is a persistence layer for [NodeJS](http://nodejs.org/) which was developed to meet my following requirements:
  10 +
  11 +// * 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.
  12 +// * I don't want to have to add or change more than a dozen lines of code.
  13 +// * I want a proper transaction log, so that the data is resilient against application crashes.
  14 +// * I want to be able to read the transaction log - I care more about making my app easily debuggable than saving disk space.
10 15
11   -// 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.
  16 +// 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/).
12 17
13 18 // Examples
14 19 // --------
@@ -16,7 +21,7 @@
16 21 // * [example-model](http://www.barricane.com/barricane-db/example-model.html)
17 22 // * [example-read-database](http://www.barricane.com/barricane-db/example-read-database.html)
18 23
19   -// There's also full, docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).
  24 +// There's also docco-generated, documentation online at [http://www.barricane.com/barricane-db/](http://www.barricane.com/barricane-db/).
20 25
21 26 // Installation
22 27 // ------------
@@ -25,7 +30,6 @@
25 30 // Reasons why BarricaneDB will never be a good fit for your application.
26 31 // ----------------------------------------------------------------------
27 32 // * Your data set is too big to fit in RAM.
28   -// * Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).
29 33 // * Your application doesn't happily shard into BarricaneDB's one-DB-per-process design.
30 34 // * You need to query your database from outside the NodeJS process - e.g. Crystal Reports.
31 35
@@ -35,7 +39,30 @@
35 39 // * You need good error handling.
36 40 // * You need async database opening (persistence is already fully async).
37 41 // * Transactions are important to you.
  42 +// * Your application needs ACID guarantees. BarricaneDB could loose 1-5 seconds of data on a process crash (OS dependent).
  43 +
  44 +// Backwards compatibility.
  45 +// ------------------------
  46 +// * We use codecs to separate the data representation from the database.
  47 +// * All future versions of BarricaneDB will be able to read v0.2.0 <code>.swoj</code> files.
  48 +
  49 +// Keep up with BarricaneDB.
  50 +// -------------------------
  51 +// * [Watch](https://github.com/chrisdew/barricane-db/toggle_watch) this project on [GitHub](https://github.com/chrisdew/barricane-db).
  52 +// * Follow the [barricane-db](https://groups.google.com/group/barricane-db) Google Group.
  53 +// * Look at the documentation on [www.barricane.com](http://www.barricane.com/barricane-db).
  54 +// * Send me an [email](mailto:cmsdew@gmail.com).
  55 +// * Follow [chrisdew](http://twitter.com/chrisdew) on Twitter.
38 56
  57 +// Roadmap
  58 +// -------
  59 +// * 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).
  60 +// * Some of the features I'd like to add include:
  61 +// # Change the DB to an emitter and make the open async.
  62 +// # Create a subscribe facility so that webclient-proxy objects can be notified on changes to objects which are displayed on user's browsers.
  63 +// # Create a more efficient delta-codec which only logs the changed fields of registered instances.
  64 +// # Add ACID transactions.
  65 +// * Anything you'd like to add? - Create an issue on GitHub.
39 66
40 67 // This file is the entry point for the NPM barricane-db package.
41 68 // It only exports symbols required from other modules.
2  package.json
... ... @@ -1,6 +1,6 @@
1 1 { "name" : "barricane-db"
2 2 , "description" : "A NodeJS-based in-process database."
3   -, "version" : "0.0.1"
  3 +, "version" : "0.2.0"
4 4 , "maintainers" :
5 5 [ { "name": "Chris Dew"
6 6 , "email": "cmsdew@gmail.com"

0 comments on commit e98520b

Please sign in to comment.
Something went wrong with that request. Please try again.