<?xml version="1.0" encoding="utf-8"?>



<feed xmlns="http://www.w3.org/2005/Atom"
    xmlns:fh="http://purl.org/syndication/history/1.0"
    xmlns:at="http://purl.org/atompub/tombstones/1.0">

    <title>Publ: Development Blog</title>
    <subtitle>A personal publishing system for the modern web</subtitle>
    <link href="http://publ.beesbuzz.biz/blog/feed?tag=deployment" rel="self" />
    <link href="http://publ.beesbuzz.biz/blog/feed" rel="current" />
    <link href="https://busybee.superfeedr.com" rel="hub" />
    
    
    <link href="http://publ.beesbuzz.biz/blog/" />
    <fh:archive />
    <id>tag:publ.beesbuzz.biz,2020-01-07:blog</id>
    <updated>2021-05-05T11:28:50-07:00</updated>

    
    <entry>
        <title>SQLite vs. Postgres, at a glance</title>
        <link href="http://publ.beesbuzz.biz/blog/616-SQLite-vs.-Postgres-at-a-glance" rel="alternate" type="text/html" />
        <published>2021-05-05T11:28:50-07:00</published>
        <updated>2021-05-05T11:28:50-07:00</updated>
        <id>urn:uuid:bb6c33bc-50d5-587e-8d94-8820bb28c7e4</id>
        <author><name>fluffy</name></author>
        <content type="html">
<![CDATA[
<p>There&rsquo;s a general belief that SQLite is a &ldquo;slow&rdquo; database and Postgres is &ldquo;fast,&rdquo; and many software packages (including FOSS) insist that SQLite is only suitable for testing and doesn&rsquo;t scale. However, this doesn&rsquo;t make much sense when you think about it; SQLite is an in-process database so there&rsquo;s no communications overhead between the service and the database, and because it&rsquo;s only designed to be accessed from a single process it can make use of optimistic locking to speed up transactions.</p><p>Since I was installing postgres for another purpose on my webserver, I decided to quickly see if Publ performs better on Postgres vs SQLite. To test the performance I compared the timing for <a href="https://beesbuzz.biz/">my website</a> on both doing a full site reindex, and rendering the Atom feed several times (using the debug Flask server and caching disabled).</p>

<p>Times are in seconds:</p>
<table>
<thead>
<tr>
<th>Database</th>
<th>Index</th>
<th>Atom feed</th>
</tr>
</thead>

<tbody>
<tr>
<td>SQLite</td>
<td>23.267</td>
<td>0.799</td>
</tr>
<tr>
<td>Postgres 12</td>
<td>26.132</td>
<td>1.270</td>
</tr>
</tbody>
</table>
<p>So, SQLite is, as I had assumed, substantially faster than Postgres, and also has much lower administrative overhead. Thus, I will continue to recommend that as the database of choice for traditionally-hosted deployments.</p><p>My belief is that, in general, if you&rsquo;re building something where there&rsquo;s only a single process connecting to the database (i.e. you don&rsquo;t have a cluster talking to a single database instance), SQLite will perform better than Postgres. The reason to use Postgres is so that you can scale to multiple processes or servers talking to a single centralized data store. If you can build your system such that each database connection can be isolated to a single database instance, SQLite is going to perform much better.</p><p>There are other considerations, of course, but if performance is your primary concern, SQLite isn&rsquo;t a bad way to go.</p>

]]>
        </content>
    </entry>
    
    <entry>
        <title>This site now self-hosted</title>
        <link href="http://publ.beesbuzz.biz/blog/570-This-site-now-self-hosted" rel="alternate" type="text/html" />
        <published>2019-12-28T23:57:06-08:00</published>
        <updated>2019-12-28T23:57:06-08:00</updated>
        <id>urn:uuid:fb1611cf-74a8-5715-a6d2-5e7a2ef38fe6</id>
        <author><name>fluffy</name></author>
        <content type="html">
<![CDATA[
<p>I&rsquo;d been running this website on Heroku&rsquo;s free tier for a while, but it&rsquo;s been getting enough traffic that it was getting close to my free runtime limit. So, I&rsquo;ve moved this over to my own personal server.</p><p>However, the <a href="http://publ.beesbuzz.biz/github-site">site repository</a> is still configured to work with Heroku (as well as being self-hosted), and you can still access the Heroku instance at <a href="http://publ.herokuapp.com/">publ.herokuapp.com</a> to see it in action. They should, for the most part, mirror one another.</p><p>Anyway, there will probably be some kinks to iron out in the meantime. But on the plus side, it means this site will finally be accessible via https!</p>

]]>
        </content>
    </entry>
    

    
</feed>