</>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

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

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
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
Databases8 min read

Your ERPNext Database Hit 40GB: What to Delete, Archive, and Partition

On most large ERPNext sites the real business data is under 20 percent of the total size. Measure the tables, gut the log bloat, chunk your deletes, understand the partitioning trap, and actually reclaim the disk.

Read
Engineering Craft7 min read

Your Migration Will Run Twice: Write It That Way

Retried deploys, scaled replicas and tired humans all re-run migrations. Advisory locks, idempotent DDL, resumable batched backfills, the CREATE INDEX CONCURRENTLY trap, and a CI check that runs it three times.

Read
Databases8 min read

HikariCP Connection Timeouts Are Not a Pool Size Problem

Connection is not available, request timed out after 30000ms almost never means the pool is too small. Here is how to find what is holding connections and fix it properly.

Read
Databases10 min read

MySQL error 1213 deadlock found: retry it, you cannot prevent it

Error 1213 is InnoDB breaking a lock cycle on purpose, not a bug you can configure away. How to read the real deadlock, fix lock ordering, and retry the transaction correctly.

Read
Databases8 min read

MySQL server has gone away: four unrelated causes, one message

Errors 2006 and 2013 are a shrug, not a diagnosis. Idle timeouts, packet size, read timeouts and a crashed server all produce them, and each needs a completely different fix.

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