Knowledge
Technical guides with sample code we ran, its real output, and references.
Websites and web apps2 min readThai dates, Buddhist and Gregorian years and time zones: designing time data in a web app without driftStore one standard time, display the year and zone the reader expects, and test dates around midnight and year boundaries.
Websites and web apps2 min readCRUD and data relationships: designing a database from the business workCreate, read, update and delete for each business record, how records relate, and rules the database should enforce itself.
Websites and web apps22 min readDocument systems in a web app: managing versions, drafts and approved copiesA document lifecycle (draft, review, approved, rejected) where approved versions are immutable, only one is current, concurrent edits are detected and requesters cannot approve their own work, built with SQLite triggers in Node 24 (Thai text).
Websites and web apps2 min readREST vs GraphQL: choosing an API style from the work and the team that maintains itHow each style asks for and returns data, where each fits, and the caching, security and tooling questions to settle before choosing.
Websites and web apps2 min readOffset vs cursor pagination: showing long lists without confusing peopleHow each method picks the next page, why rows can repeat or go missing while data changes, and which one suits which list.
Websites and web apps24 min readTwo people book the same slot at once: understanding transactions and preventing data conflictsReproduce two requests seeing the same free slot and both booking it, then fix it three ways: a UNIQUE constraint, a locking transaction and a conditional UPDATE, with runnable Node 24 code, real output and reference SQL for PostgreSQL and MySQL (Thai text).
Websites and web apps27 min readBackground jobs and queues: moving heavy work off the web app screenA background job queue on node:sqlite: leases that expire when a worker dies, idempotency keys, exponential backoff with jitter and a dead-letter table, with runnable TypeScript and real output (Thai text).
Websites and web apps2 min readPolling, SSE and WebSocket: choosing how to update data on screenHow each method delivers updates, the load and complexity each brings, and how often the screen really needs to change.
Websites and web apps2 min readWhat a cache is: a faster website without stale data or someone else's dataWhere caches sit, how long data may be reused, and why private pages must never be cached for everyone.
Websites and web apps24 min readA web app for many companies: separating each organisation's data in a multi-tenant systemIsolating many organisations in one database: tenant_id, composite keys the database enforces, a repository that takes the tenant from the session, and cross-tenant tests, with runnable TypeScript, real output and PostgreSQL row-level security SQL (Thai text).
Websites and web apps29 min readOnline booking for service businesses: designing time slots, capacity and cancellationsDefining slots and capacity, holding a slot while the customer confirms, and clear cancellation and rescheduling rules.
Websites and web apps27 min readA preliminary price estimator on the website: calculating so customers understand the conditionsA price estimator whose business rules live in one versioned file: integer satang, explicit rounding, VAT shown separately, a reason for every line and reproducible old quotes, with runnable TypeScript and real output (Thai text).

