</>CodeWithKarani
All topics
Topic

Databases

PostgreSQL, MySQL/MariaDB and Redis - connections, locks, slow queries, backups and the failures that take a database offline.

Sub-topics

54 articles · showing 1-9 (page 1 of 6)

AI Engineering6 min read

Metering, model routing and the regression suite that stops your agent rotting

Two questions decide whether an AI feature survives its first year: does each request make money, and will a prompt edit break something silently? An append-only credit ledger, two-tier routing, and a suite that asserts question-to-metric mappings are the answers.

Read
Mobile Engineering16 min read

Six ways Android will eat your background service, and what actually worked

A broadcast receiver is a lie, WAL journalling wedged openDatabase on OxygenOS, and one polite database close in a WorkManager teardown silently stopped the whole gateway. Six real failure modes from a production Android SMS gateway, and the fix for each.

Read
Frappe/ERPNext8 min read

What bench migrate actually does, and the rollback you'll wish you had

Every patch commits as it completes and records itself as applied. So a migration that fails halfway is not a failed migration, it is a half-finished one, and re-running will not undo it. Here is the recovery, with real commands.

Read
AI Engineering6 min read

Shipping a business agent on WhatsApp: templates, webhooks and the 24-hour window

The in-app chat panel was good and nobody opened it. Putting the agent on WhatsApp means the Cloud API's template rules, idempotent webhooks, per-tenant scheduled jobs, alert hysteresis, and testing that Sheng routes to the right metric.

Read
Databases8 min read

Find the Query Killing Your ERPNext: A MariaDB Slow Query Log Playbook

Your ERP is slow and three queries are responsible. Configure the MariaDB slow query log properly, run pt-query-digest, and read the numbers that tell you whether it is an index problem or a hardware problem.

Read
AI Engineering9 min read

Building RAG Over Your ERP Data: The Architecture That Actually Survives Production

Most ERP chatbots fail the moment someone asks for a total. Here is the two-plane architecture, the hybrid retrieval SQL, the reranking step and the permission model that separate a demo from a system finance will actually trust.

Read
Databases9 min read

Indexes That Actually Work: A Field Guide to tabGL Entry and tabStock Ledger Entry

ERPNext ships mostly single-column indexes, which are the wrong shape for the reports killing your server. Real EXPLAIN output, the leftmost prefix rule, key_len maths, and the composite indexes that fix ERP reports.

Read
AI Engineering7 min read

Why we did not point an LLM at ERPNext: building a semantic layer for a business agent

Text-to-SQL against a real accounting schema produces confidently wrong numbers, because ERPNext stores revenue in the general ledger, stock valuation in the stock ledger, and gross margin nowhere at all. Here is the metric catalog and catalog-first hybrid engine we built instead.

Read
Databases8 min read

bench backup Is Not a Backup Strategy: Binlogs and Point-in-Time Recovery for ERPNext

A nightly dump means losing a full day of invoices. Set up mariadb-backup plus binary logs, then walk a real recovery: finding the binlog position of a bad bulk cancel and replaying up to the second before it.

Read
Databases - Guides, Sub-topics & Fixes · Code With Karani