Two Dev.to posts describe “ctrodb,” a client-side database and the broader argument for keeping more data logic in the browser. The author says many web apps routinely send data to a backend that never needs to leave the client, such as form drafts, UI preferences, cached responses, and offline queues. They argue that round trips to a server introduce latency and duplicate state when applications cache API results while also storing copies in React state or Redux. The proposed alternative is a client-side database model: data lives where it is used, while the server mediates shared state, authentication, and coordinated writes.
The second post details how ctrodb implements this idea for TypeScript. It runs in the browser using IndexedDB and in Node.js with an in-memory backend, with “zero runtime dependencies.” It provides MongoDB-like CRUD, schema validation at write time, query capabilities with filtering/sorting/pagination, indexes, and reactive updates. The package includes plugins for full-text search, model relations, and custom validation, plus React hooks for signal-based reactivity. The posts also offer examples and links to a playground, documentation, npm, and GitHub.