Validate complete member sets before atomic upserts
A batch result is the full expected member set under one batch key, not one existing row. This note defines read and write rules that never mistake a partial set for completion.
PostgreSQL · Kafka · data strategy notes
A batch result is the full expected member set under one batch key, not one existing row. This note defines read and write rules that never mistake a partial set for completion.
Content search commonly uses ILIKE '%term%' over post titles, descriptions, slugs, and lesson bodies. Escaping the query and limiting its length are safety contracts; because of the leading and trailing wildcards, a nor…
File upload and search availability are different states. Only a search copy that finished parsing, embedding, and storage—and has processed = TRUE—may become evidence for a user answer.
An operational database cannot be changed in one shot like a fresh database. Preserve existing rows, converge to the same state on repeated runs, and expose enough failure context for a safe retry.
When a project ships content (Markdown, JSON, CSV…) as DB seed, where those files live is a surprisingly big decision. The obvious place — inside the app folder that consumes them (frontend/myapp/content/) — turns out t…
The Supabase note covered Storage in just one paragraph. This note goes deep on exactly that spot — bucket design, upload/delete code, per-file permissions (RLS), the S3-compatible API, and signed URLs. The practical qu…
Whether to use Kafka at all is covered in another note. This one is the next step — how to name topics, how to size partitions and choose keys, how to write Producer and Consumer code. Concepts settle once you learn the…
An admin console or back office may need one process to access separate content, catalog, and operations databases. Direct pools can be useful, but connection budgets, permissions, and failure isolation must be designed…
Making data is not a backup. Restoring is. The difference only shows up after an incident. Here is a summary of PostgreSQL's tools, policies, and rehearsals.
Code that handles images shows up often. Resize an uploaded photo, convert formats, generate thumbnails.
To deliver messages on mobile or web while the app is closed, the push channels provided by the OS or the browser must be traversed. iOS has APNs, Android has FCM, and the web has the Web Push standard.
Supabase emerged as an alternative to Firebase, an open-source backend bundle. PostgreSQL sits at the core, with auth, storage, realtime, and serverless functions stacked around it.
The trend of combining large language model responses with external knowledge has settled under the name RAG (Retrieval-Augmented Generation). At its core sits vector similarity search, and PostgreSQL's pgvector extensi…
Kafka is often called a "queue," but more precisely it is a distributed commit log. Its strengths show beyond queues. At the same time, it is overkill for a simple work queue.
Systems that handle external data reduce to similar steps everywhere. Fetch the data, clean it, store it, and expose it.
Redis started as an in-memory key-value store, but today it covers cache, sessions, queues, ranking, distributed locks, and pub/sub all at once.
Cache rarely sits in only one place. It usually stacks across several layers. Closer to the client is faster; closer to the DB is more accurate.
The longer we use PostgreSQL, the more we run into a few concepts at least once: MVCC, indexes, EXPLAIN, isolation levels, VACUUM, partitioning.
Choosing a data store is often a burden. NoSQL, distributed SQL, graph DBs, time-series DBs all line up. Yet for many projects, PostgreSQL alone is enough for a long time at the start.
PostgreSQL, MySQL, SQLite, SQL Server, Oracle — they all share similar core syntax. Learn it once and we keep using it for life.