Package-level declarations

Types

Link copied to clipboard
class MongoReservationStore(client: MongoClient, databaseName: String, clock: Clock = Clock.systemUTC(), dispatcher: CoroutineDispatcher = VirtualThreads.dispatcher, ddl: Ddl = Ddl.AUTO, sharding: MongoSharding = MongoSharding.AUTO, operationTimeout: Duration = MongoTimeouts.OPERATION) : ReservationStore

The ReservationStore on MongoDB (documentation/designs/01-programming-model.md §7): one collection per aggregate type, wow_reservation__<context>__<aggregate> (the type is the unit of placement, so its reservations follow its log's store), created with its format record on the type's first use. One document per reserved key, {_id: {t: tenant_id, n: namespace, k: key}, tenant_id, key, owner: {tenant_id, id}, expires_at, holds, version}: the key is the _id (the system tenant is the empty string), its tenant and key also plain fields, the shard key's; the owner is of the collection's type. A null expires_at marks a confirmed reservation, version the owner's fact that last confirmed it; a pending one expires at that epoch millisecond and is held by the attempts in holds, without a version. Every operation finds a reservation by its key, so the collection has no index but the _id's (and the shard key's when sharded). The layout is format FORMAT.