Static databases for static sites. Possible?

Regular readers will know about my love of simple, static-hosted, web-based apps that are easy to build and maintain, and free to host. But they are held back by the lack of dynamic data. Sure, you can store data in local storage, but what if you want to share data between browsers? Is there a way to do that that is simple and ultra-low-cost for side-projects that I let the world use for free?

A simple solution is fine. I don’t plan using this for large volumes of data. So is there some kind of key-value (KV) store I can put a JSON blob in using a simple REST API that is somehow secure?

I’ve mentioned this on social media a couple of times. I get responses suggesting tools. The responses I get are good, but they are things like Fauna, Redis, Supabase, Cloudflare KV, DynamoDB, rqlite and KVdb.

All of these fall into one or more of these categories:

  • Doesn’t have an HTTP API
  • Requires me to jump through lots of hoops to set up
  • Requires me to self-host
  • Is just overkill for what I want to do

Even though some of them have decent free tiers, I still think these don’t meet the need that I have.

There’s also an overriding feeling that these just wouldn’t work for an everyday person.

When I try to discuss it, people don’t seem to quite understand the requirement.

So let me try to explain what I think I would like.

I have a static-file web application. It’s just HTML, CSS and JavaScript.

I want to read and write data to a data store using a simple REST API call that takes two parameters: a key name, and a data value.

The endpoint should be authenticated for security. The API key or password should be per-user and per-app and should be stored in the browser’s local storage.

The per-user thing is important. This avoids the application having an application key that needs to be kept safe.

It also means that I as the app developer don’t have to be responsible for user data and privacy. It leaves the user in control of their own data. All I provide is the JavaScript code that moves the data around. The data is either in your browser, or it’s pushed to a place that you own and control.

From an end-user’s point of view this is like having your own personal KV store. Like a Dropbox but for data. You connect each app to your datastore’s account. Or you manually get an API key and save it in the app. Then the app can push and pull the data.

Aside: Yes, I could just connect to Dropbox and save the data as a JSON file. The downside of this is that the JSON files exist in the user’s Dropbox and can be accessed, which could be dangerous. I could also use Apple’s CloudKit, which basically works this way but without showing data to the user. But it needs an Apple account which doesn’t make for a very cross-platform solution.

To be clear:

  • This should be online/cloud-based with an HTTP API (probably a REST API).
  • This should not be a database. I do not expect schemas to be defined. Storing long strings is totally fine.
  • This should not be self-hosted – perhaps that could be an option if people want it.
  • Everything should be as simple as possible: auth, API calls, data structures.

These static apps work by reading text files over HTTP. I want this system to be as simple as possible. Reading the data can be reading a static file using HTTP (with user identification and auth!). Writing the data should be as simple as that too.

It’s really simple to make a service like this. I could build one in Laravel in probably about half an hour.

But my guess is that this doesn’t exist because:

  • It’s hard to market it. It’s difficult to explain to end-users exactly what this is. And that limits the audience.
  • Nothing that writes data on the web is easy. You need to consider authentication, privacy, security, spam, misuse, scaling, backups, legal stuff. So there isn’t enough value here to become a service.

Scaling up my ambitions: What if this was actually a web standard? A protocol for simple read/write of key/value data from web pages. One where users could choose a provider and connect web apps by providing an endpoint URL and a password – or using some oAuth-like system. Where users control their data, and can export/migrate their data to another platform. Like the Fediverse but for data?

I know this is a pipe dream. Something with little value. Something just for little indie devs like me.

But also, I love the idea of these simple, applications running in the browser. And if there was some simple way to save data perhaps making things like this would be more popular? And for end-users, signing up to try a new app wouldn’t come with all the give-us-your-email-address-and-sign-your-life-away stuff.

I remember when I first encountered an app like this. It was Gaya Kessler’s “Thyme” time-tracker. And I was stunned that I could use it by just clicking a button. No sign up. No login. Just start using it. I was surprising. Delightful. And, at the time, disconcerting. How was this storing my data? But once I understood, I immediately knew more applications should be like this.

What do you think? Am I missing something? Does this exist? Is it actually pointless? Should I accept that I’m the only person in the world that wants this and just sign up for Supabase?