Write some more docs
authorChip Black <bytex64@bytex64.net>
Sat, 8 Jan 2011 11:19:35 +0000 (03:19 -0800)
committerChip Black <bytex64@bytex64.net>
Sat, 8 Jan 2011 11:20:26 +0000 (03:20 -0800)
www/css/doc.css
www/doc/index.html
www/index.html

index cfe64b6..bb28947 100644 (file)
@@ -3,6 +3,7 @@
  */
 body {
        font: 14pt serif;
+       margin: 16pt;
 }
 
 h1, h2, h3, h4, h5 {
index 3d40ad0..fb2ddc7 100644 (file)
@@ -6,17 +6,45 @@
 </head>
 <body>
 
-<h1>Blërg Documentation</h1>
+<h1>Blërg</h1>
+
+Blërg is a minimalistic tagged text document database engine that also
+pretends to be a <a href="/">microblogging system</a>.  It is designed
+to efficiently store small (&lt; 64K) pieces of text in a way that they
+can be quickly retrieved by record number or by querying for tags
+embedded in the text.  Its native interface is HTTP &mdash; Blërg comes
+as either a standalone HTTP server, or a CGI.  Blërg is written in pure
+C.
+
+<ul class="toc">
+  <li><a href="#installing">Installing</a>
+    <ul>
+      <li><a href="#getting_the_source">Getting the source</a></li>
+      <li><a href="#requirements">Requirements</a></li>
+      <li><a href="#configuring">Configuring</a></li>
+      <li><a href="#building">Building</a></li>
+      <li><a href="#installing">Installing</a></li>
+    </ul>
+  </li>
+  <li><a href="#design">Design</a>
+    <ul>
+      <li><a href="#motivation">Motivation</a></li>
+      <li><a href="#web_app_stack">Web App Stack</a></li>
+      <li><a href="#database">Database</a></li>
+      <li><a href="#problems_and_future_work">Problems and Future Work</a></li>
+    </ul>
+  </li>
+</ul>
 
-<h2>Installing</h2>
+<h2><a name="installing">Installing</a></h2>
 
-<h3>Getting the source</h3>
+<h3><a name="getting_the_source">Getting the source</a></h3>
 
 <p>There's no stable release, yet, but you can get everything currently
 running on blerg.dominionofawesome.com by cloning the git repository at
 http://git.bytex64.net/blerg.git.
 
-<h3>Requirements</h3>
+<h3><a name="requirements">Requirements</a></h3>
 
 <p>Blërg has varying requirements depending on how you want to run it
 &mdash; as a standalone HTTP server, or as a CGI.  You will need:
@@ -39,7 +67,7 @@ sense of humor, requires ruby to compile)</li>
 <li><a href="http://www.newbreedsoftware.com/cgi-util/download/">cgi-util</a> &gt;= 2.2.1</li>
 </ul>
 
-<h3>Configuring</h3>
+<h3><a name="configuring">Configuring</a></h3>
 
 <p>I know I'm gonna get shit for not using an autoconf-based system, but
 I really didn't want to waste time figuring it out.  You should edit
@@ -52,7 +80,7 @@ makefile refuses to work with BSD make.  If you have patches or
 suggestions on how to make Blërg more portable, I'd be happy to hear
 them.
 
-<h3>Building</h3>
+<h3><a name="building">Building</a></h3>
 
 <p>At this point, it should be gravy.  Type 'make' and in a few seconds,
 you should have <code>http_blerg</code>, <code>cgi_blerg</code>,
@@ -60,7 +88,7 @@ you should have <code>http_blerg</code>, <code>cgi_blerg</code>,
 individually as well, if you, for example, don't want to install the
 prerequisites for <code>http_blerg</code> or <code>cgi_blerg</code>.
 
-<h3>Installing</h3>
+<h3><a name="installing">Installing</a></h3>
 
 <p>While it's not required, Blërg will be easier to set up if you
 configure it to work from the root of your website.  For this reason,
@@ -93,15 +121,16 @@ feeds for users.  Install this like the CGI version above (on my server,
 it's at /rss.cgi).
 
 
-<h2>Design</h2>
+<h2><a name="design">Design</a></h2>
 
-<h3>Motivation</h3>
+<h3><a name="motivation">Motivation</a></h3>
 
 <p>Blërg was created as the result of a thought experiment: "What if
 Twitter didn't need thousands of servers? What if its millions of users
 could be handled by a single highly efficient server?"  This is probably
 an unreachable goal due to the sheer amount of I/O, but we could
-certainly do better.  Blërg was designed with very simple requirements:
+certainly do better.  Blërg was thus designed as a system with very
+simple requirements:
 
 <ol>
 <li>Store and fetch small chunks of text efficiently</li>
@@ -112,7 +141,7 @@ certainly do better.  Blërg was designed with very simple requirements:
 <p>And to further simplify, I didn't bother handling deletes, full text
 search, or more complicated tag searches.  Blërg only does the basics.
 
-<h3>Web App Stack</h3>
+<h3><a name="web_app_stack">Web App Stack</a></h3>
 
 <table class="pizzapie">
 <tr><th>Classical model</th></tr>
@@ -165,7 +194,7 @@ and server data is always returned in JSON format.
 href="http://couchdb.apache.org/">CouchDB</a>, though I didn't know that
 until after I wrote Blërg. :)
 
-<h3>Database</h3>
+<h3><a name="database">Database</a></h3>
 
 <p>Early in the design process, I decided to blatantly copy <a
 href="http://www.varnish-cache.org/">varnish</a> and rely heavily on
@@ -210,13 +239,20 @@ index record simply stores the user and record number.  Tags are
 searched by opening the tag file, reading the last 50 entries or so, and
 then reading all the records listed.  Voila, fast tag lookups.
 
+<p>At this point, you're probably thinking, "Is that it?"  Yep, that's
+it.  Blërg isn't revolutionary, it's just a system whose requirements
+were pared down until the implementation could be made dead simple.
+
 <p>Also, keeping with the style of modern object databases, I haven't
 implemented any data safety (har har).  Blërg does not sync anything to
 disk before returning success.  This should make Blërg extremely fast,
 and totally unreliable in a crash.  But that's the way you want it,
 right? :]
 
-<h3>Problems and Future Work</h3>
+<h3><a name="problems_and_future_work">Problems and Future Work</a></h3>
+
+<p>Blërg probably doesn't actually work like Twitter because I've never
+actually had a Twitter account.
 
 <p>I couldn't find a really good fast HTTP server library.
 Libmicrohttpd is small, but it's focused on embedded applications, so it
index 6b25550..729ff19 100644 (file)
   <div id="welcome">
   <h2>I am 12 and what is this</h2>
 
-  <p>Blërg is a miniblogging platform.  It's less limited than
-  microblogging platforms like <a
-  href="http://twitter.com/">Twitter</a>, but much simpler than
-  full-blown blogging platforms like <a
-  href="http://wordpress.com/">Wordpress</a> or <a
-  href="http://livejournal.com/">Livejournal</a>.  Blërg is also an open
-  source tagged text database engine written in C that does the back-end
-  work.</p>
+  <p>Blërg is a microblogging platform.  Or maybe a miniblogging
+  platform.  Blërg is not sure.  Blërg is a lot like <a
+  href="http://twitter.com/">Twitter</a>, but aims to fix some of its
+  idiosyncracies.  Blërg does not want to be a full blogging platform
+  like <a href="http://wordpress.com/">Wordpress</a> or <a
+  href="http://livejournal.com/">Livejournal</a>.  Blërg is also an <a
+  href="/doc/">open source tagged text database engine</a> written in C
+  that does the back-end work. Blërg's author finds it entertaining to
+  anthropomorphize Blërg in the third person.</p>
 
   <h2>But what's wrong with Twitter?</h2>
 
-  <p>I'M GLAD YOU ASKED. While I don't believe the basic social premise
-  of Twitter is broken, there are two facets of it that are IMNSHO just
-  wrong:</p>
+  <p>I'M GLAD YOU ASKED. There are two aspects of Twitter that just bug
+  me as an engineer:</p>
   
   <ol>
   <li><strong>Ruby on Rails</strong> - Using rails to prototype a system is
-  fine &mdash; scaling up to a million hits a day with it is just poor
-  engineering. As the service grew, I'm sure it cost them a lot more
-  time than it saved.</li>
+  fine &mdash; scaling up to a million hits a day with it is just a bad
+  idea. As the service grew, I'm sure it cost them a lot more time than
+  it saved.</li>
   <li><strong>140 characters is not enough</strong> - I routinely write
-  sentences longer than 140 characters, so I can't imagine even beginning to
-  make a point in such a small space.  This textual confinement has led to the
-  rise of URL shorteners, which are <a
+  sentences longer than 140 characters, so I can't even begin to imagine
+  making a point in such a small space.  This textual confinement has
+  led to the rise of URL shorteners, which are <a
   href="http://bytex64.net/blog/e2256">breaking the internet</a>.
   </ol>
 
   fully functional service created in a fit of hubris to poke fun at Twitter's
   engineering.  It's just for fun, but no one is going to keep you from using
   it seriously. :]</p>
+
+  <h2>Tell me more about this database engine.</h2>
+
+  <p>Here, take a look at the <a href="/doc/#design">design docs</a>.</p>
+
   </div>
 
   <div id="navigation">