gitwtfhub

wtf is buckets-oss?

crossdeckhq/buckets-oss — explained in plain English

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

A TypeScript library that tracks database read and write costs per function and per user, so you can see exactly who and what is driving your database bill.

Mindmap

mindmap
  root((buckets-oss))
    What it does
      Track DB read costs
      Attribute reads to users
      Name expensive operations
    Tech Stack
      TypeScript
      Firestore MongoDB Postgres
      npm package
    Use Cases
      Debug surprise DB bills
      Find expensive API routes
      Track reads by user
    Audience
      Backend developers
      DevOps FinOps teams
    Output
      Local Markdown file
      Crossdeck dashboard

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Find out which API route or feature is causing a sudden spike in your Firestore or Postgres bill.

REASON 2

See which specific users are responsible for the most database reads in your app.

REASON 3

Separate background job database usage from user-driven usage so you can optimize each independently.

What's in the stack?

TypeScriptFirestoreMongoDBPostgreSQLNode.js

How it stacks up

crossdeckhq/buckets-oss0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Works without any account in local-file mode, a Crossdeck API key is only needed for the cloud dashboard.

MIT license, use, modify, and distribute freely for any purpose, including commercial projects.

Wtf does this do

Buckets is a small TypeScript library that tracks exactly how many database reads, writes, and deletes your app is making, and which user or function caused each one. The core problem it solves is a common billing surprise: your Firestore, MongoDB, or Postgres bill jumps unexpectedly and your database provider's dashboard shows you the total count but not which part of your app triggered the spike or whose request caused it. The library installs as a thin layer in front of your database calls. You initialize it once at app startup and it automatically intercepts every read and write across your entire codebase, counting them in memory without adding extra queries to your database. You can wrap a specific function or API route with a bucket() call to give it a label, and all the database operations inside that wrapper are grouped under that name in the output. Operations you do not label explicitly still appear, grouped by collection or table name. To connect a database read to the specific user who triggered it, you call setActor(userId) at your request boundary, the moment you know who is logged in. From that point, every database operation in that request is tagged with that user's ID. Background jobs and scheduled tasks can be labeled as machine so they are tracked separately from user-driven activity. The readout is a plain Markdown file written to a .crossdeck folder in your project directory, listing each bucket by name and its read count in order of size. You can print it with a single terminal command at any time. A cloud dashboard is available through the Crossdeck service if you supply an API key, but the local readout works with no account at all. Supported databases are Firestore, MongoDB, and Postgres. The library is MIT licensed and published as an npm package. The full README is longer than what was shown.

Yoink these prompts

Prompt 1
I'm using buckets-oss with Firestore in my Express app. How do I wrap all my route handlers in a single line to name every read by route pattern?
Prompt 2
How do I set up buckets-oss with MongoDB instead of Firestore? Walk me through installing the meter and naming my first bucket.
Prompt 3
My buckets readout shows one unlabeled bucket with 50K reads. How do I find which function in my codebase is causing it?
Prompt 4
How do I use buckets-oss in a Firebase Cloud Function where each request is a separate async invocation?

Frequently asked questions

wtf is buckets-oss?

A TypeScript library that tracks database read and write costs per function and per user, so you can see exactly who and what is driving your database bill.

What language is buckets-oss written in?

Mainly TypeScript. The stack also includes TypeScript, Firestore, MongoDB.

What license does buckets-oss use?

MIT license, use, modify, and distribute freely for any purpose, including commercial projects.

How hard is buckets-oss to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is buckets-oss for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.