Databases are either general purpose and therefore aren't optimized to the specific situation (e.g. sqlite3, which isn't even very concurrent) or else they are massive things that can optimize into a plethora of different situations (e.g. postgres). So you either suffer the "not optimal" or the "massive". By rolling your own, you suffer neither.
I'm doing it because it is fun and is a learning experience. I am well aware that I am reinventing the wheel. My brother is a core postgres developer. We have spoken on the phone and he understands what I am doing and says that it is similar to what postgres already does and why don't I use postgres? Because I wouldn't learn anything if I just used postgres. And it would be massive and a deployment nightmare.
I'm using sled (a key value database) as the underlying technology of my indices, so strictly speaking I am using a database and I'm not entirely reinventing. The remaining parts that I chose to write myself were not too difficult. The specific use cases of a personal nostr relay are rather constrained so I can optimize for them fairly quickly without it taking months of work.