Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Flat File Storage in Known #1631
Geez. I'm paying an incredible amount in DBA taxes  when hacking on my self hosted VPS that is running Known. I'm sure a large amount of this is due to me being a bit of a n00b, but I've mostly found that Known works perfectly most all of the time, but database problems often add tens of hours of headaches every few months with the two Known websites I've been running.
Also, I'm bitter right now because my MongoDB database got hacked and now I can't access over 2 years worth of Known content. On my other Known site, mariaDB stopped working after I upgraded it and it took 3 months to finally get it working again. I am a hobbyist, I'll admit, and I don't work on my website all the time, but this prevented me from using Known, which I love to publish on, for a good while there. It sounds dumb that it took me so long, but it probably took me 20 hours to get mariadb running again after it entered a failed state on an upgrade. I would have rather spent that time hacking Known, but I should also disclose that part of the problem was that I was newly familiarizing myself with SystemD as well and dealing with that didn't come intuitively.
After taking a peek on their wiki, it seems like there are a number of people in the IndieWeb community that advocate against complex databases like MongoDB, MariaDB, PostgreSQL and MySQL.
They suggest that complex databases work against a core principles  of the IndieWeb movement, the goal of longevity  of one's content and data (including permalinks). They say we should try to build for the long web. 
I am not trying to bash on Known for only using complex databases, but I would like to start a discussion around whether Known could be modified to store main (primary) site content in flat files in a filesystem. Perhaps needing a database is baked in to the program. If not, maybe someone will read the stuff in this thread and be inspired to try to add a plugin to add support for flat file storage.
Here's some links to people who aren't using complex database in the IndieWeb community.
Edit: I changed a lot of the text of this after posting it because I really disliked the tone after I re-read it.
I don't know, maybe the majority of my issues are related to not working hard enough to learn mariadb / MySQL.
Also, it seems as though postres users seem to not feel very burdened by their database software based on these reports: https://indieweb.org/Postgres
I've used it a little bit but haven't gotten into it much. I really appreciate that Known supports Postgres. Thanks for the hard work that you guys have done and specifically for adding Postgres support. I'm going to test out Known+Postgres for my next site and see how it goes. Also, I'm going to try to understand SQL better in general, since I'll likely need to as I install more web apps in the future.
Closing this, this sort of discussion should go to the discussion group https://groups.google.com/forum/#!forum/known-dev or #knownchat IRC channel.
But, in short there are a number of very good reasons why Known uses a (number of different options of) database for storage.
For those who feel strongly about avoiding database for backend storage, and are prepared to accept the consequences, I encourage you to look at the DataConcierge class hierarchy. It is entirely possible to write a plugin that maps the data queries to another mechanism/flat file store (although I imagine search will suffer unless some effort is taken to provide some sort of lookup mechanism), however I doubt this'll ever be something that is built out for the core project.