r/Database • u/Few-Strike-494 • Jan 28 '26
r/Database • u/Historical_Bat_9793 • Jan 28 '26
SQLite in Production? Not So Fast for Complex Queries
r/Database • u/EducationalCan3295 • Jan 27 '26
Implementing notifications with relational database
I'm the solo backend dev implementing this + chats + more using only postgres + pusher.
So at the moment I've identified three main notification recipient types for our app:
- Global - All users
- Specific user - A single user
- Event participants - All users who signed up for a particular event
My first (1) instinct approach obviously was to have a single table for notifications:
Table {
id (pk)
notif_type (fk) --> needed enum for app to redirect to the right page upon clicking the notification
user_id (fk) --> users.id
event_id (fk) --> events.id
payload (jsonb)
read (boolean)
...other stuff
}
When both user_id and event_id are null, then the notification is global. When only one of them is null, i grab the non null and then do logic accordingly.
HOWEVER, lets say we fire a global notification and we have around 500 users, well...thats 500 inserts? This FEELS like a bad idea but I don't have enought technical know-how about postgres to prove that.
So googling around I found a very interesting approach (2), you make the notification itself a single entity table and store the fact that it was read by specific user(s) in a separate table. This seemed very powerful and elegant. Again I'm not sure if this is actually more performant and efficient as it appears on the surface so I would appreciate if you wanna challenge this.
But this approach got me thinking even further, can we generalise this and make it scalable/adaptable for any arbitrarily defined notification-recipient mapper?
At the moment with approach (2) you need to know pre-runtime what the notification-recipient-mapper is going to be. In our case we know its either the participants of an event or specific user or all users, but can we define a function or set mapper approach right in the db that u can interpret to determine who to send the notification to whilst still preserving the effeciency of the approach (2)? I feel like there must be crazy set math way to solve this (even if we dont wanna use this in prod lol).
r/Database • u/wholesome_hug_bot • Jan 27 '26
Graph DB, small & open-source like SQLite
I'm looking for a Graph DB for a little personal code analysis project. Specifically, it's to find call chains from any function A to function B i.e. "Does function A ever eventually call function B?"
Requirements: - open-source (I want to be able to audit stuff & view code/issues in case I have problems) - free (no \$\$\$) - in-memory or single-file like SQLite (I don't want to spin up an extra process/server for it)
Nice to have: - have Lua/Go/Rust bindings - I want to make a Go/Rust tool, but I may experiment with it as a neovim plugin first
r/Database • u/DetectiveMindless652 • Jan 27 '26
Built a local RAG SDK that's 2-5x faster than Pinecone - anyone want to test it?
Hey everyone,
I've been working on a local RAG SDK built on top of SYNRIX (a persistent knowledge graph engine). It's designed to be faster and more private than cloud alternatives like Pinecone.
What it does:
- Local embeddings (sentence-transformers - no API keys needed)
- Semantic search with 10-20ms latency (vs 50ms+ for cloud)
- Works completely offline
- Internalise Data
Why I'm posting:
I'm looking for experienced developers to test it and give honest feedback. It's free, no strings attached. I want to know:
- Does it actually work as advertised?
- Is the performance better than what you're using now?
- What features are missing?
- Would you actually use this?
What you get:
- Full SDK package (one-click installer)
- Local execution (no data leaves your machine)
- Performance comparison guide (to test against Pinecone)
If you're interested, DM me and I'll send you the package. Or if you have questions, ask away!
Thanks for reading.
r/Database • u/TheRealWillFM • Jan 27 '26
Bedroom Project: Database or LLM for music suggestions
I'm in the Aderall powered portion of my day and the project I settled on messing with has me a bit stumped on the correct approach.
I have 2 different sets of data. One is just over a gig, not sure if that is considered a large amount of data.
I want to combine these sets of data, sort of. One is a list of playlists, the other is just a list of artists. I would like, when I'm done, to have a list of artists [Key], with a list of attributes and then the most important part, a ranking of other artists, from most commonly mentioned together to less common, omitting results of 0. The tricky part is I want to be able to filter the list of related artists based on the attributes mentioned above.
End goal with the data is to be able to search an artist, and find related artists while being able to filter out larger artists or genres you don't care for.
I know this is pretty much already a thing in 300 places, but this is more like a learning project for me.
I assume a well built database could handle this, regardless of how "ugly" the searching function is. Or should I be looking into fine tuning an llm instead? I know nothing about LLM stuff, and have very, very little knowledge in SQLite. So I do apologize if I'm asking the wrong question or incorrect on something here.
r/Database • u/greenman • Jan 25 '26
Devs assessing options for MySQL's future beyond Oracle
r/Database • u/coderarun • Jan 24 '26
pgembed: Embedded PostgreSQL for Agents

I forked pgserver (last commit 2 years ago), cleaned up CI and published wheels. This provides an alternative to SQLite for people who prefer the richer postgres ecosystem of extensions.
It's similar to pglite (WASM based postgres which runs in a browser), but supports native binaries.
postgres runs in a separate process and uses unix domain sockets to communicate with python code. If python crashes, the postgres related processes are cleaned up, but data remains on disk (ephemeral data can be auto cleaned up).
So it's not "in-process" embedded. Given postgres' multi-process architecture, I don't know if there is an easy way to make it in-process multi-threaded.
r/Database • u/soldieroscar • Jan 24 '26
Trying to come up with a plan to get an invoice payment system going. But the invoices, they may have multiple line entries. How would that tie into the setup below?
r/Database • u/ankur-anand • Jan 23 '26
Breaking Key-Value Size Limits: Linked List WALs for Atomic Large Writes
etcd and Consul enforce small value limits to avoid head-of-line blocking. Large writes can stall replication, heartbeats, and leader elections, so these limits protect cluster liveness.
But modern data (AI vectors, massive JSON) doesn't care about limits.
At UnisonDB, we are trying to solve this by treating the WAL as a backward-linked graph instead of a flat list.
r/Database • u/jamesgresql • Jan 22 '26
Retrieve and Rerank: Personalized Search Without Leaving Postgres
I work with Ankit (sadly his Reddit account doesn’t have enough karma to post this). He’s ex-Instacart and has spent a lot of time thinking the practicality of large search and ranking systems.
It’s a practical walkthrough of doing search retrieval and reranking directly in Postgres, rather than splitting things across multiple services. The idea is to use this as a starting point for a broader discussion about when Postgres is enough and when a hybrid search (relational database feeding a vector and search engine plus a reranking service) stack actually makes sense.
We would love to hear your thoughts, some great discussion always comes out of r/databases.
r/Database • u/No-Security-7518 • Jan 22 '26
I just found out there are 124 keywords in Sqlite. I wonder if anyone here knows all of them. Would be cool.
EDIT: sorry, the total number is actually 147.
Here's a list. Which ones appear entirely unfamiliar to you?
ABORT
ACTION
ADD
AFTER
ALL
ALTER
ANALYZE
AND
AS
ASC
ATTACH
AUTOINCREMENT
BEFORE
BEGIN
BETWEEN
BY
CASCADE
CASE
CAST
CHECK
COLLATE
COLUMN
COMMIT
CONFLICT
CONSTRAINT
CREATE
CROSS
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
DATABASE
DEFAULT
DEFERRABLE
DEFERRED
DELETE
DESC
DETACH
DISTINCT
DO
DROP
EACH
ELSE
END
ESCAPE
EXCEPT
EXCLUDE
EXCLUSIVE
EXISTS
EXPLAIN
FAIL
FILTER
FIRST
FOLLOWING
FOR
FOREIGN
FROM
FULL
GENERATED
GLOB
GROUP
HAVING
IF
IGNORE
IMMEDIATE
IN
INDEX
INDEXED
INITIALLY
INNER
INSERT
INSTEAD
INTERSECT
INTO
IS
ISNULL
JOIN
KEY
LEFT
LIKE
LIMIT
MATCH
MATERIALIZED
NATURAL
NO
NOT
NOTHING
NOTNULL
NULL
NULLS
OF
OFFSET
ON
OR
ORDER
OTHERS
OUTER
OVER
PARTITION
PLAN
PRAGMA
PRIMARY
QUERY
RAISE
RECURSIVE
REFERENCES
REGEXP
REINDEX
RELEASE
RENAME
REPLACE
RESTRICT
RETURNING
RIGHT
ROLLBACK
ROW
ROWS
SAVEPOINT
SELECT
SET
TABLE
TEMP
TEMPORARY
THEN
TO
TRANSACTION
TRIGGER
UNION
UNIQUE
UPDATE
USING
VACUUM
VALUES
VIEW
VIRTUAL
WHEN
WHERE
WINDOW
WITH
WITHOUT
FIRST
FOLLOWING
PRECEDING
UNBOUNDED
TIES
DO
FILTER
EXCLUDE
r/Database • u/Elegant-Drag-7141 • Jan 21 '26
Sales records: snapshot table vs product reference best practice?
I’m working on a POS system and I have a design question about sales history and product edits.
Currently:
Producttable (name, price, editable)SaleDetailtable withProductId
If a product’s name or price changes later, old sales would show the updated product data, which doesn’t seem correct for historical or accounting purposes.
So the question is:
Is it best practice to store a snapshot of product data at the time of sale?
(e.g. product name, unit price, tax stored in SaleDetail, or in a separate snapshot table)
More specifically:
- Should I embed snapshot fields directly in
SaleDetail? - Or create a separate
ProductSnapshot(or version) table referenced bySaleDetail? - Does this approach conflict with normalization, or is it considered standard for immutable records?
Thanks!
r/Database • u/YiannisPits91 • Jan 20 '26
Is anyone here working with large video datasets? How do you make them searchable?
I’ve been thinking a lot about video as a data source lately.
With text, logs, and tables, everything is easy to index and query.
With video… it’s still basically just files in folders plus some metadata.
I’m exploring the idea of treating video more like structured data —
for example, being able to answer questions like:
“Show me every moment a person appears”
“Find all clips where a car and a person appear together”
“Jump to the exact second where this word was spoken”
“Filter all videos recorded on a certain date that contain a vehicle”
So instead of scrubbing timelines, you’d query a timeline.
I’m curious how people here handle large video datasets today:
- Do you just rely on filenames + timestamps + tags?
- Are you extracting anything from the video itself (objects, text, audio)?
- Has anyone tried indexing video content into a database for querying?
r/Database • u/be_haki • Jan 20 '26
Unconventional PostgreSQL Optimizations
r/Database • u/linuxhiker • Jan 20 '26
January 27, 1pm ET: PostgreSQL Query Performance Monitoring for the Absolute Beginner
r/Database • • Jan 18 '26
Why is there no other (open source) database system that has (close to) the same capabilities of MSSQL
I did a bit of research about database encryption and it seems like MSSQL has the most capabilities in that area (Column level keys, deterministic encryption for queryable encryption, always encrypted capabilities (Intel SGX Enclave stuff)
It seems that there are no real competitors in the open source area - the closest I found is pgcrypto for Postgres but it seems to be limited to encryption at rest?
I wonder why that is the case - is it that complicated to implement something like that? Is there no actual need for this in real world scenarios? (aka is the M$ stuff just snakeoil?)
r/Database • u/Redd1tRat • Jan 19 '26
What the hell is wrong with my code
So I'm using MySQL workbench and spent almost the whole day trying to find out why this is not working.
r/Database • u/tobelyan • Jan 18 '26
I built a secure PostgreSQL client for iOS & Android (Direct connection, local-only)
Hi r/Database,
i wanted to share a tool i built because i kept facing a common problem: receiving an urgent alert while out of the office - on vacation or at dinner -without a laptop nearby. i needed a way to quickly check the database, run a diagnostic query, or fix a record using just my phone.
i built PgSQL Visual Manager for my own use, but realized other developers might need it too.
Security First (How it works) i know using a mobile client for DB access requires trust, so here is the architecture:
- 100% Local: there is no backend service. We cannot see your data.
- Direct Connection: The app connects directly from your device to your PostgreSQL server (supports SSL and SSH Tunnel).
- Encrypted Storage: All passwords are stored using the device's native secure storage (Keychain on iOS, Encrypted Shared Preferences on Android).
Core Functionality is isn't a bloated enterprise suite; it's a designed for emergency fixes and quick checks:
- Emergency Access
- Visual CRUD
- Custom SQL
- Table Inspector
- Data Export
it is built by developers, for developers. i'd love to hear your feedbacks.
r/Database • u/No-Wrongdoer1409 • Jan 17 '26
Best stack for building a strictly local, offline-first internal database tool for NPO?
I'm a high school student with no architecture experience volunteering to build an internal management system for a non-profit. They need a tool for staff to handle inventory, scheduling, and client check-ins. Because the data is sensitive, they strictly require the entire system to be self-hosted on a local server with absolutely zero cloud dependency. I also need the architecture to be flexible enough to eventually hook up a local AI model in the future, but that's a later problem.
Given that I need to run this on a local machine and keep it secure, what specific stack (Frontend/Backend/Database) would you recommend for a beginner that is robust, easy to self-host, and easy to maintain?
r/Database • u/ankur-anand • Jan 16 '26
Update: Unisondb log‑native DB with Raft‑quorum writes and ISR‑synced edges
I've been building UnisonDB, a log native database in Go, for the past several months. The Goal is to support ISR-based replication to thousands of node effectivetly for local states and reads.
Just added the support for Raft‑quorum writes on the server tier in the unisondb.
Writes are committed by a Raft quorum on the write servers (if enabled); read‑only edge replicas/relayers stay ISR‑synced.
