HACKER Q&A
📣 kashnote

A Dumb Database?


I have two scenarios where I want to store certain values outside of my main database and I'm looking for a SaaS solution.

1: When a user joins my website, I want to show them a Welcome popup. Once they see this popup, I want to mark has_seen_welcome_popup to true. Next time they log in, I'll know not to show it to them. This is just one example. I may want to have a dozen of these sort of values defined per user.

2: Let's say I have a banner on the landing page that says "40% off" and I want to change that to "30% off." Instead of making a code change, I want to make this change in some sort of UI in the SaaS and have it update automatically.

---

Basically just need a place to store little things that I don't really want to store in the main database. And some nice UI where I can toggle those values as an admin without touching the prod DB.

My initial thought is to use Airtable but I'm not sure if there is something more purpose-built for this sort of scenario.


  👤 feoren Accepted Answer ✓
I'm really not sure why you wouldn't just store the current sale value in the database and build a simple UI to manage it. Why don't you want to store it in the main database? This "side database" will grow and grow and soon you won't know whether to put new features in the main database or the side database and now you have two different databases to maintain with two different tech stacks ... why are you doing this to yourself?

👤 rudasn
Maybe some sort of JSON document database?

CouchDB is quite easy to maintain and it has a built-in admin UI you can use to easily edit your documents. To retrieve your JSON documents on the client side you'd use the http api, eg GET /database_name/document_id.

Or, you know, just use json/plain text file(s) on your server and be done with it..


👤 throwaway81523
If your application already has a database, just make another table for the stuff you want. Relying on another SaaS for these small bits of data is just asking for trouble and downtime. There are tons of hosted databases available (e.g. redis.com) and Cloudflare Workers could be another approach, but I wouldn't bother with any of them.

Also, there is nothing wrong with being a beginning web dev, and your question is not a dumb question, but I'd have to call it a beginner question. I'm not sure HN is the right place for that. Someplace like Stackexchange or Reddit might be more suitable.


👤 speedgoose
First one can easily be solved using the local storage web API.

https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage...

Second one could be a file served though HTTP. Like a JSON in a S3 bucket, or an index.html on a Linux/nginx VM. A file system is a database.


👤 joeld42
Firebase is a good idea. But also just using local storage for less important user data (like has_seen_welcome) and having your SaaS store stuff (like 40% sales) in a settings file or something like that still works. Don't underestimate the value of keeping things simple and reducing dependencies.

👤 Nextgrid
Do you have a backend? If so it might be easy to just use that. Big frameworks like Django provide an auto generated admin UI for your DB tables so that would satisfy your requirement of having a UI to edit things without making raw queries to the DB.

👤 d_watt
I'll +1 firebase as the easiest managed solution for this work. There are competitors like supabase that can do the same thing. Alternatively, where both your examples are about showing things to the user, maybe product walkthrough software like appcues is more approptiate.

I'd caution against Airtable, last time I used them in this capacity, the API rate limiting / response time made it a no go. I'd err more on something like hasura if you want a flexible CRM like that.


👤 michaelanckaert
How about something like https://kv.build8.io/ ?

👤 altdataseller
This sounds like an use case for Firebase

👤 oblib
I'll 2nd CouchDB for a server side solution, but you could also use PouchDB to store that data in the user's web browser. That wouldn't work when they access it with a different browser, but that may not be a bad thing, and could be useful.

👤 patatino
I would recommend supabase, used it in my side projects, couldn't be happier.

👤 leros
Sounds like Firestore from Firebase would be a good solution for you. It's a database that you can use with just a few lines of JavaScript.

👤 rozenmd
The term of art you're looking for is "KV Store" - something like Amazon DynamoDB, Cloudflare Workers KV or Firestore would do the trick

👤 rad_gruchalski
Backblaze with server side lru cache. One object per kv. Eventually, CF workers with kv.

👤 XCSme
A normal "not dumb" database can also do "dumb" things.

👤 cyanydeez
The correct answer for #1 is just client side scripts using local storage.

👤 monsterofcookie
Cookie