Introduction to Flat-File CMS
I started out re-writing the core of Wordpress to Elixir around last year. Once of the decisions I had to make was with databases. I started out with flat files as well and realized they can quickly grow complex when you have more than a handful articles. Eg. If you want to add some new attributes to the flat files, they can&#x27;t be backported to the older articles if the number of articles is quite large.<p>Guess what? That&#x27;s the problem that the SQL databases already solve.<p>So, to circumvent this, I searched for a database that can be version controlled but doesn&#x27;t require a separate database server. And I found one - SQLITE.<p>It&#x27;s been amazing so far. It can be inside my GitHub repo, while giving me access to normal SQL queries via my ORM.
With a static file solution built on just flat files, complex querying is definitely not possible.
With now over 30,000 posts in the SQLITE database, my static file generator is still absolutely fast.<p>I now use my solution for a high traffic client with 3-4 million visitors a month and it works really well for them.<p>One downside of SQLITE is multiple concurrent writes, but so far it hasn&#x27;t been much of a problem yet.