Where the idea came from
This site has no database, and that was a deliberate decision I reached while studying how attackers think.
I was reading about red team strategies, the methods used to attack a system the way a real adversary would. A pattern kept showing up: much of an attacker's early work is finding things to attack. Every component that accepts input, stores data, or listens on a network is a possible way in. A database is one of the biggest of those components, and it often holds everything of value.
That led me to a simple question. If I do not need a database, why would I run one?
What taking out the database removes
A flat-file design stores content as plain files that the application reads directly, instead of in a separate database service. For a site like mine, that removes several things at once:
- A whole class of attacks. Attacks that trick an application into running hostile database commands have nothing to target when there is no database to receive them.
- A service to run and defend. There is no database server to patch, no database account whose password could leak, and no database port to protect.
- A single store of everything. An attacker who gets into a database often gets all of the data at once. Separate files with tight permissions make that harder.
I am careful about the claim here. A flat-file design shrinks the attack surface. It does not remove it, and I explain what remains in the section on trade-offs.
How I applied it here
Removing the database was one decision in a larger set. I deliberately keep the specifics off this page, because publishing exact file locations, names, or limits would help the people I am trying to keep out. The principles are what matter:
- Content lives in plain files, kept outside the part of the server the public can reach.
- Secrets are kept out of the code and out of cloud storage. Keys and authentication details live in locked-down files on the server only.
- Permissions are as narrow as I can make them. Each file is readable by only what needs it.
- The admin area is protected in layers. It requires a second factor, limits repeated login attempts, and checks that every request really came from me.
- Fewer moving parts. Every piece I do not run is a piece I do not have to defend.
The result is also practical. Blogging is simple, pages are quick to manage, and I can see exactly where my data lives.
A Spreadsheet as the Data Layer
In this architecture, a single master spreadsheet maintained locally serves as the authoritative data store. Each row represents one record, and each column represents an attribute; in a product catalog, for example, these would include a unique identifier (SKU), name, category, brand, price, quantity, description, and image location. Content is created and revised through ordinary spreadsheet editing, then exported as a comma-separated values (CSV) file, a format selected for its simplicity and interoperability. The file is submitted through the authenticated administrative interface, where the server processes it in stages rather than accepting it directly.
Before any change takes effect, the server validates the submission against a defined set of rules. It verifies that each identifier is unique, that numeric fields contain valid numbers, that required fields are populated, and that categorical values are normalized by removing extraneous whitespace and standardizing capitalization, which prevents a single brand from being recorded as two distinct entries. The administrator is then shown a summary of the proposed changes (for example, the number of records added, updated, removed, and rejected), which allows errors to be identified before publication. Upon approval, the validated data is written to a temporary file and substituted for the live file in a single operation, so that visitors never encounter a partially updated state. A timestamped copy of each accepted upload is retained, providing version control and the ability to restore any prior state. Referenced images may also be retrieved and stored locally during import, which preserves availability if the original source is removed.
The application then reads from this one file, which is held in memory and refreshed whenever a new upload is approved. Navigation structures are derived automatically from the unique values in the category and brand columns, so a new category or brand appears as soon as the data is published, with no manual page creation. Filtering is performed by selecting the rows that match a given value, and each product page is generated from its row. Because the identifier is permanent, re-uploading a revised row updates the existing record instead of creating a duplicate, which reproduces the update behavior of a conventional database table. The principal limitation concerns data that changes continuously, such as inventory, because the spreadsheet is current only as of its last upload. To address this, I treat the spreadsheet as the authoritative source for descriptive attributes and initial quantities, record each transaction in a separate append-only log, and calculate current availability by subtracting logged sales from the baseline quantity. This design prevents a routine re-upload from overwriting inventory with outdated values.
What a flat file does not fix
I would be misleading you if I said that no database means no risk. It does not, and my choice has real costs.
- Other attacks remain. Anything that accepts input, such as a login form or an editor, can still be abused. Careless handling of file names and paths can let an attacker reach files they should not.
- Permissions become the security. With no database enforcing access, everything depends on getting file permissions right. One mistake there can expose more than a database account would.
- It does not scale. Flat files suit a small site with one author. A busy site with many people writing at the same time needs the locking and structure that databases provide.
- Backups are my job. Nothing protects my content from my own mistakes or a failed disk except the backups I keep.
My claim appears narrower than "flat files are secure." For a small, single-author site, they let me trade features I do not need for a smaller surface I can fully understand.
Why this belongs in a leadership and security journal
This is a technical choice, but I see it as a leadership decision first. Nothing forced me to remove the database. I chose to, because I decided that simplicity was worth more than convenience, and then I accepted the work that came with it.
That is the kind of decision my thesis is about. Leaders set the conditions that shape security long before any attacker shows up, by deciding what to build, what to run, and what to leave out. On this site I am the leader, the structure, and the employee all at once, so the three pillars of my research collapse into one person. That makes it a useful, if small, test of my own ideas.
In a larger organization, the same choice would involve many people, and getting everyone to accept less convenience for less risk is the hard part.
My view
I think many small sites run a database out of habit, not need. Before adding a component, I now ask what it gives me and what it gives an attacker. If I cannot justify it, it stays out.
That is my flat-file philosophy: build only what the job requires, understand all of it, and lock down what is left.