Re: [PATCH 02/17] object-store: rename `object_directory` to `odb_backend`
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 7, 2025, 00:51 UTC
- Message-ID
- <e23e7e63-1d66-4a5c-8c4e-19b5078a75ad@gmail.com>
- In-Reply-To
- <20250506-pks-object-store-wo-the-repository-v1-2-c05b82e7b126@pks.im>
On 5/6/25 7:09 AM, Patrick Steinhardt wrote:
Show 12 quoted lines
> The `object_directory` structure is used as an access point for a single > object directory like ".git/objects". While the structure isn't yet > fully self-contained, the intent is for it to eventually contain all > information required to access objects in one specific location. > > While the name "object directory" is a good fit for now, this will > change over time as we continue with the agenda to make pluggable object > databases a thing. Eventually, objects may not be accessed via any kind > of directory at all anymore, but they could instead be backed by any > kind of durable storage mechanism. While it seems quite far-fetched for > now, it is thinkable that eventually this might even be some form of a > database, for example.
I agree that "object directory" is leaking some of the abstraction, and that we'd want to be able to have pluggable ODB backends.
Show 12 quoted lines
> As such, the current name of this structure will become worse over time > as we evolve into the direction of pluggable ODBs. Immediate next steps > will start to carve out proper self-contained object directories, which > requires us to pass in these object directories as parameters. Based on > our modern naming schema this means that those functions should then be > named after their subsystem, which means that we would start to bake the > current name into the codebase more and more. > > Let's preempt this by renaming the structure to `odb_backend` now > already. This name is agnostic of how exactly objects are stored and > allows us to easily introduce e.g. a `files_odb_backend` and other > specific implementations over time.
But here's where I'll get a little nitpicky and say that these are "odb"s not "odb_backend"s.
* odb: a single object database. A repo can have multiple, currently only one that is read/write and multiple read-only alternates.
* odb backend: an _implementation_ of an object database. This would be the structure that containts a vtable of implementation methods. Each individual 'odb' would point to a single backend describing how to access the data in it.
Does that make sense? If we are going through the effort of renaming things, I think it's worth being a little more future-proof here.
Thanks, -Stolee