TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Smaller is better – The rise, fall, and rise of flat file software

232 pointsby riidomalmost 3 years ago

33 comments

GuB-42almost 3 years ago
Maybe it is just a reflection on the state of filesystems vs databases.<p>There is no fundamental difference between a database and a flat file, it is all bytes on a disk&#x2F;memory in the end. So it is mostly a question of balancing the roles of the hardware, OS, and application software.<p>For example, if the reason you are using a database is that it does a particularly good job at limiting disk IO, then it may not be necessary with fast SSDs. If your reason for splitting into small files is to save RAM, it may not be necessary if you have more RAM. If you want to do to a distributed architecture, maybe your filesystem is not up to the task and you may want a database server.
评论 #31470445 未加载
评论 #31470552 未加载
评论 #31470418 未加载
评论 #31469677 未加载
评论 #31471611 未加载
评论 #31471190 未加载
评论 #31470846 未加载
评论 #31473939 未加载
lionkoralmost 3 years ago
HN, are you feeling okay?<p>Many top posts in the past weeks were all about using SQLite for usecases it wasnt originally designed to do, using it as a distributed database, even.<p>Now, here&#x27;s a post which misses the EXACT usecase sqlite was built for, and its barely even mentioned.<p>SQLite is quite literally the best solution here. Its a file, you open it, and boom you got a database. You can explore it with sqlite3 cli or datagrip or anything you want.<p>This is like saying &quot;lets use png for animated images&quot; and then searching for &quot;a format to handle uncompressed images with transparency&quot; and not mentioning png.
评论 #31476945 未加载
config_ymlalmost 3 years ago
I remember when I got started with webdev around 2002, a lot was built on flat files. And so did I, because that’s how my “internet mentor” did it: guestbooks, bulletin boards, mailing lists, shoutboxes, CMSs. All in flat files, except I used php and not Perl like him.
评论 #31469909 未加载
评论 #31470329 未加载
评论 #31470506 未加载
评论 #31469741 未加载
评论 #31470001 未加载
cschwarmalmost 3 years ago
I&#x27;m trying to get away from a DB-based CMS for some company web sites. Static generators won&#x27;t do for a number of reasons, so a flat-file CMS seems like a good fit.<p>Currently I&#x27;m looking at GravCMS [1] as an alternative. It&#x27;s free initially, but it can become somewhat expensive with many official plugins. But it&#x27;s file format is Markdown, and one can combine multiple files into a so-called modular page. It has a backend for editing, forms and e-mailing of form submissions. Seems perfect for small and mid-sized company web site.<p>Another option I considered was Kirby [2]. Its backend UI is configurable. That&#x27;s nice in theory but the documentation is somewhat lacking, in my opinion. I&#x27;ve used the starterpack and it took me hours to find the one command to be able to add new pages. Its content format is also custom, not Markdown. Finally, it&#x27;s €100 per site.<p>Also, a few days ago, I stumbled upon Typemill [3] which I will check next week.<p>[1] <a href="https:&#x2F;&#x2F;getgrav.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;getgrav.org&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;getkirby.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;getkirby.com&#x2F;</a><p>[3] <a href="https:&#x2F;&#x2F;typemill.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;typemill.net&#x2F;</a>
评论 #31471372 未加载
hemmertalmost 3 years ago
I can‘t recommend Kirby enough:<p><a href="https:&#x2F;&#x2F;www.getkirby.com" rel="nofollow">https:&#x2F;&#x2F;www.getkirby.com</a><p>I built many of my (project) websites with it,<p><a href="https:&#x2F;&#x2F;www.humangodinterfaces.com" rel="nofollow">https:&#x2F;&#x2F;www.humangodinterfaces.com</a><p><a href="https:&#x2F;&#x2F;www.perspectives-in-play.com" rel="nofollow">https:&#x2F;&#x2F;www.perspectives-in-play.com</a><p><a href="https:&#x2F;&#x2F;www.fabianhemmert.com" rel="nofollow">https:&#x2F;&#x2F;www.fabianhemmert.com</a><p><a href="https:&#x2F;&#x2F;www.escape-team.com" rel="nofollow">https:&#x2F;&#x2F;www.escape-team.com</a><p>it‘s blazingly fast (performance-wise and in terms of building your site), super easy to customize and I never missed my database.
评论 #31472190 未加载
评论 #31472237 未加载
评论 #31474871 未加载
RedShift1almost 3 years ago
<i>uncle roger voice</i> just use SQLite haiyaaaaa
评论 #31470969 未加载
评论 #31470069 未加载
评论 #31473139 未加载
evacchialmost 3 years ago
I originally wrote <a href="https:&#x2F;&#x2F;www.flatpress.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.flatpress.org&#x2F;</a> as an alternative to WordPress with a flat-file database. I no longer work on it, but an enthusiast user (Arvid) took over the development, so it is now actively maintained.
DeathArrowalmost 3 years ago
A file system can be considered a document database with the key being the file name.
评论 #31471922 未加载
评论 #31473188 未加载
analyst74almost 3 years ago
Database is basically just ab abstraction to help you ingest and query flat files on disk.<p>If you skip that and do your own ingestion and querying...you just have a built-in database?<p>This might have some performance shortcomings, but given maturity of caching these days, you can probably just add caching layer in front of the inefficient query engine when the needs arise.
riidomalmost 3 years ago
As someone not overly backend proficient, I love the concept of flat-file. I just rebuilt my blog with another flat file CMS, literally finished it last night, and today I am reading this article and think, whether WonderCMS may have been a better choice.. but, no I won&#x27;t start over.<p>The CMS I picked is PicoCMS - what flat file stuff have you used and can recommend? And probably important, how well does it scale? I cant give much input here, my blog has 21 posts so.. no ceiling in sight yet.<p>Here I made a post where I ramble a bit about blog systems, as far as I got in contact: <a href="https:&#x2F;&#x2F;riidom.eu&#x2F;posts&#x2F;021_en" rel="nofollow">https:&#x2F;&#x2F;riidom.eu&#x2F;posts&#x2F;021_en</a>
评论 #31468234 未加载
评论 #31469205 未加载
评论 #31468915 未加载
drawingthesunalmost 3 years ago
I like plaintext as I have the option to make edits with various editors in addition to the main application.<p>This can lead to easier search and manipulation.<p>I use Logseq and Noteplan, both store data in plaintext.<p>As a secondary editor to both I use Sublime Text for very fast search and replace, or diagnosing why Logseq might be having issues.<p>I’ve had issues before in other note taking &#x2F; task apps and when I run into problems it is much harder to search and manipulate a database file. That’s even if the app has a sensible database format.<p>Of course depending on how you use and might need edit data you might find databases are better for you. I’ve always found it easier to work with plaintext for note taking&#x2F; task apps.
评论 #31473208 未加载
eternityforestalmost 3 years ago
Lately I&#x27;ve become a pretty big believer in flat files.<p>I don&#x27;t see much value at all in small software for the sake of being small, but files are something really special.<p>You can SyncThing them. You can version control them. You can browse and delete them.<p>And best of all, they&#x27;re not really flat anymore. A file is a typed object that tools know how to work with(As long as you do the sane thing and use a common file type).<p>Databases are often appropriate, but in those cases, I think sqlite is the better choice more often than not, unless you&#x27;ve truly got a large number of users all doing things at once.
ushakovalmost 3 years ago
i’m using Zola static site generator for my website (after switching from Wordpress)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;getzola&#x2F;zola" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;getzola&#x2F;zola</a><p><a href="https:&#x2F;&#x2F;mishushakov.gumroad.com&#x2F;l&#x2F;mish-zola" rel="nofollow">https:&#x2F;&#x2F;mishushakov.gumroad.com&#x2F;l&#x2F;mish-zola</a><p>if you need more than that for a static blog (like Gatsby&#x2F;NextJS) i’d consider you unreasonable
评论 #31469308 未加载
concombrealmost 3 years ago
I use PluXml[1] for a while on my personal blog en other sites I&#x27;ve created. The contents is stored in XML files. To be fast, the post creation date and tags are stored directly in the filename. This hence benefits from native OS file search.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;pluxml&#x2F;PluXml" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pluxml&#x2F;PluXml</a>
评论 #31469269 未加载
cultofmetatronalmost 3 years ago
sqlite seems better here. text files need to be parsed and loaded. fsOpen has sifficient overhead to be noticable when you use it a lot. unless you&#x27;re statically pregenerating the html, sqlite is a super fast format with good library support and will give you the fastest access to the disk and its still a flat file.
juangacovasalmost 3 years ago
I think DokuWiki also deserves a mention for being pretty flat-file with a lot of features and extensions
评论 #31472685 未加载
EGregalmost 3 years ago
Why don’t more people store all the uploaded files inside BLOBS in a relational database instead of a file system? What are the downsides?<p>I see the biggest downside being that the webserver will call your PHP app which will then proxy the data through itself one time. Well, maybe you can use ReactPHP or Swoole and then it’s faster than Node.js even…<p>Also you then have more programmable options, for example around access control lists or capabilities to access stuff, caching and expiring caches.<p>How does MySQL compre to ext3 for storing terabytes of data?<p>As a side note - what do y’all think of FUSE to Amazon S3? Just map a path to it and let it do the rest. GOOFYS I think skimps on the POSIX compliance in favor of speed.
评论 #31473207 未加载
phs318ualmost 3 years ago
This seems like the perfect post to spruik this cool tool (not mine, but greatly appreciated by me):<p><a href="http:&#x2F;&#x2F;ff-extractor.sourceforge.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;ff-extractor.sourceforge.net&#x2F;</a><p>The Flat File Extractor command line utility has saved my bacon a few times in my career. If I&#x27;m dealing with legacy code, data migrations, needing to quickly perform some surgical extraction or munging into another format - ffe is the tool for me.<p>EDIT: looks like someone&#x27;s forked and update the tool. <a href="https:&#x2F;&#x2F;github.com&#x2F;igitur&#x2F;ffe" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;igitur&#x2F;ffe</a>
rikrootsalmost 3 years ago
When I rebuilt my poetry website (using Svelte) I was really keen to get rid of any need for a database on the backend (to save a few pennies on the hosting). I ended up with a folder for all the poems (html snippets) which the frontend can fetch when user navigates to a poem&#x27;s page. The metadata associated with the poems went into a json file which gets fetched on initial page load.<p>If I did the work today I&#x27;d probably store the metadata in an SQLite database running on the frontend, but I&#x27;d keep the poem copy in their own files in the folder.
Danborgalmost 3 years ago
Using flat files only solves half the problem, in order to truly be able to host anywhere, you also need to be able to ditch PHP and server side processing requirements. (Wonder CMS, highlighted in this article, requires PHP with a couple of mods.) That’s why I think static site generators are the more interesting code in this space. I’m a big fan of Gatsby, but there are several other great ones as well. This allows you to host your blog on even an old school “tilde club” type site, and it works just fine.
评论 #31473035 未加载
kazinatoralmost 3 years ago
Sometime in the late 1990&#x27;s, some programmer in some forum was bragging about the speed of some program of his that was working with a 50,000 record database. I don&#x27;t remember all the exact details. I replied something along the lines that I regularly load text files having more lines than that into a text editor, that it&#x27;s almost instant on today&#x27;s hardware.
sotteroalmost 3 years ago
I feel like you can achieve some pretty awesome feats with a few files and docker. Setting up a simple Mongodb is dead simple. Adding a Fast API is dead simple. Serving a small site via Flask is dead simple. And with a simple docker exec command I can dump the database to JSON. And I can even use Mongo Compass to tinker with the database and try out queries and create indices.
atonsealmost 3 years ago
Does it have to be one or another with SQLite?
bitwizealmost 3 years ago
Guile was my CMS in the early 00s. Page data was stored in a sexpr file, which a Guile script read and turned into pages.
shadowofneptunealmost 3 years ago
Is a flat file usually considered text, or can it be a binary format as well? Different websites give different answers.
评论 #31470146 未加载
jqpabc123almost 3 years ago
Flat file is more suited toward small, well defined with simple integration requirements. A lot of simple web sites and services fall into this category.<p>If there is any possible need to integrate into a larger overall system in ways that have yet to be fully imagined or defined, a DBMS might be a better option.
sgbealalmost 3 years ago
The article&#x27;s author seems surprised that there&#x27;s a flat-file forum. What if we told them that the Fossil SCM is a flat-file (sqlite3) forum, wiki, _and_ SCM all in the same flat file? (Commenting on the original article requires an account i&#x27;m not willing to set up.)
voidfuncalmost 3 years ago
I used to run a shared webhost provider back in the early 2000s. Flat-file software was a big deal for our customers back then because MySQL and PostgreSQL databases cost actual money.
g5095almost 3 years ago
Is sqlite a flat file disqualifier?
评论 #31557998 未加载
评论 #31470383 未加载
评论 #31476621 未加载
ra33oalmost 3 years ago
I can recommend HTMLy and automad.<p>HTMLy can easily work with 20.000 posts, without any noteworthy slowdown.
评论 #31471561 未加载
irrationalalmost 3 years ago
One benefit of flat file is you can host it on GitHub pages.
rob_calmost 3 years ago
Turns out there are many ways to keep doing things wrong that about the problem being users...
yawnxyzalmost 3 years ago
Flat file websites make sense when you have a blog and such. I don&#x27;t even know why you&#x27;d use a CMS when Next.js or SvelteKit can just generate all the pages from a folder with markdown files. Just write your content in Markdown or pull your content in at the static build stage and your content is ready to go.<p>Can anyone explain how sites like Flatboard handle user input into a flat file system? How do they handle conflicts with just one file? What&#x27;s the workflow and set up like — can you use serverless or do you have to have a full server?
评论 #31468295 未加载
评论 #31468248 未加载