Repositories, transactions, and unit of work in GoDecoupling business logic from storage in Go, adding transaction support without leaking SQL details, and coordinating atomic writes across multiple repositories using a unit of work.Redowan Delowar·Mar 21·13 min readFollowGoDatabaseDesign Patterns
How do you handle transactions with the repository pattern?Adding transaction support to a repository interface without leaking storage details.Redowan Delowar·Mar 20·3 min readFollowGoDatabase
Do you need a repository layer on top of sqlc?Decoupling business logic from storage with a small interface in Go.Redowan Delowar·Mar 16·2 min readFollowGoDatabase
Hierarchical rate limiting with Redis sorted setsBuild multi-level rate limiting with Redis sorted sets and Lua. Enforce global and category-specific limits with ZREMRANGEBYSCORE and ZCARD commands.Redowan Delowar·Jan 12·5 min readFollowDatabasePythonSystemRedis
Sorting a Django queryset by a custom sequence of an attributeSort Django querysets by custom attribute sequences using Case and When expressions for database-level ordering with SQL CASE statements.Redowan Delowar·May 9·4 min readFollowPythonDjangoDatabase
Switching between multiple data streams in a single threadPoll multiple data sources in a single thread using Python generators with itertools.cycle to alternate between infinite data streams efficiently.Redowan Delowar·Feb 19·2 min readFollowPythonDatabaseTIL
Manipulating text with query expressions in DjangoUse Django query expressions like Replace, Upper, Lower, Concat, and Substr for efficient database-level text manipulation without fetching data.Redowan Delowar·Jan 7·4 min readFollowPythonDjangoDatabase
Faster bulk_update in DjangoAccelerate Django bulk_update operations by 4x using multiprocessing to parallelize database writes across chunked record batches.Redowan Delowar·Nov 30·2 min readFollowPythonDjangoDatabase
Recipes from Python SQLite docsPractical SQLite recipes for Python: execute statements, batch operations, transactions, row factories, and context managers with sqlite3.Redowan Delowar·Sep 11·11 min readFollowDatabasePythonSQL
Pick random values from an array in SQL(ite)Emulate Python's random.choice in SQLite using JSON arrays and the random() function. Populate tables with realistic test data efficiently.Redowan Delowar·Sep 2·3 min readFollowDatabaseSQLData Structures
Bulk operations in Django with process poolSpeed up Django bulk operations with ProcessPoolExecutor while preserving signals and hooks that bulk_create/bulk_update bypass.Redowan Delowar·Jun 27·3 min readFollowPythonDjangoConcurrencyDatabase