HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
kahing
catfs
Rust2017–2023
kahing / catfs

catfs

Cache AnyThing filesystem written in Rust

4Distinct people
9Mentions
0Explicit recommenders
935GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Cache AnyThing filesystem written in Rust

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year9 dated mentions

Observed mentions: 2017-07-21 17:21:49 UTC to 2023-09-13 23:33:08 UTC.

0123452017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC514
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC211

What Hacker News says

9 sources
> We've had some ideas around using this for distributed querying: in our case, each node responsible for a given partition of a dataset would be able to download just the objects in that partition on the fly (though constraint pruning), so we wouldn't need to knowingly seed each worker with data. IMHO, if you're going to do this, I'd recommend not doing this in Postgres itself, but rather doing it at the filesystem level. It's effectively just a tiered-storage read-through cache, and filesystems have those all figured out already. You know how pgBackRest does "partial restore" (https://pgbackrest.org/user-guide.html#restore/option-db-inc...), by making all the heap files seem to be there, but actually the ones you don't need are sparse files ftruncate(1)'d to the right length to make PG happy? And that this works because PG only cares ab
Read the rest
out DB objects it's not actively querying insofar as making sure they're there under readdir(2) with the expected metadata? Well, an object-storage FUSE filesystems, e.g. https://github.com/kahing/goofys, would make PG just as happy, because PG could see all the right files as "being there" under readdir(2), even though the files aren't really "there", and PG would block on first fopen(2) of each file while goofys fetched the actual object to back the file. (IIRC PG might fopen(2) all its files once on startup, just to ensure it can; you can hack around this by modding the origin-object-storage filesystem library to not eagerly "push down" its fopen(2)s into object fetches — instead just returning a file-descriptor connected to a lazy promise for the object — and then have read(2) and write(2) thunk that lazy promise, such that the first real IO done against the virtual file be what ends up blocking to fetch the object.) So you could just make your pg_base dir into an overlayfs mountpoint for: • top layer: tmpfs (only necessary if you don't give temp tables their own tablespace) • middle layer: https://github.com/kahing/catfs • bottom layer: goofys mount of the shared heap-file origin-storage bucket Note that catfs here does better than just "fetching objects and holding onto them" — it does LRU cache eviction of origin objects when your disk gets full! (Of course, this setup doesn't allow writes to the tables held under it. So maybe don't make this your default tablespace, but instead a secondary tablespace that "closed" partitions live in, while "open" partitions live in a node-local tablespace, with something like pg_partman creating new hourly tables, and then pg_cron running a session to note down the old ones and do a VACUUM FREEZE ?; ALTER TABLE ? SET TABLESPACE ?; on them to shove them into the secondary tablespace — which will write-through the catfs cache, pushing them down into object storage.)
In Scalable PostgreSQL Connection Pooler
Open source project so not quite a "site": submitted goofys (https://github.com/kahing/goofys/) 644 days ago and had 40 upvotes on HN, and from what I recall I had a couple hundred stars on github right after. Now I am approaching 900 stars, a niche community of users, and occasional drive-by contributions. Compare to catfs (https://github.com/kahing/catfs/) which I recently posted but did not make to front page, and right now it's at 14 stars. I would say both projects have similar audiences comparable in complexity, which would mean front page on HN gave goofys a 20x or so boost in terms of github stars. Note that the first time I posted goofys it did not make it to front page. @dang emailed me to re-post it and the second time it was boosted to front page.
In Ask HN: HNers who got their “Show HNs” on homepage, how is your site doing now?
For 1: https://users.rust-lang.org/t/conflicting-lifetime/11887 Or any time you want to use thread and closure. I know I am joining the threads before the references go away but it's not possible to express that. There's scoped threadpools but sometimes it's at a higher level than scope. 2: Can't get the return value for close(). readdir doesn't return the offset. I ended up wrapping libc myself: https://github.com/kahing/catfs/blob/master/src/catfs/rlibc.... I guess wrt string, it's extra frustrating because on unix, OsStr is really CStr but I get former (from command line) and often need latter for interacting with libc. Also when you learn Rust you first learn about str and String even though in my case I actually want to avoid them. Admittedly that's probably rare. Having every type duplicated (a ref type and a storage type) also incr
Read the rest
eases the complexity.
In Show HN: Catfs – Cache AnyThing Filesystem Written in Rust

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.