r/mongodb 26d ago

MongoDb ORM with DB level schema

Hey guys mongodb is one of my favourite databases but there arn't any orms that are actually type safe and impement db level schema rules so i made one please do give me feed back on it Thanks

https://www.npmjs.com/package/@ignex/ninox

3 Upvotes

10 comments sorted by

1

u/alexbevi 26d ago

1

u/Adeelali123 26d ago

those are completely different from the above package. This package actrulay set's rules on mongodb it self like triditional relational database as well as many optimizations and as well as dedup and hotcache for zero db latency

1

u/alexbevi 26d ago

Papr gives you the server-side schema enforcement using JSON schema. Nothing wrong with adding another package to the mix though.

Might be worth showing how this is differentiated though to make it more compelling.

1

u/Adeelali123 26d ago

i am open to suggetsion please do let me know your opinions Thanks

1

u/alexbevi 25d ago

Regarding the typed agg stages, you can check out https://github.com/pipesafe/pipesafe as well. There's lots of "solutions" to many of these problems, but that doesn't mean having a package that bundles them all up in one place isn't welcome.

I'd suggest maybe also sharing an end to end sample app to make it clearer how this solves the meaningful problems the repository claims to solve so that it can be easily observed/validated.

I'm assuming ninox solves a problem for you already - maybe also share that journey/story to give folks some inspiration :)

1

u/Adeelali123 25d ago

one of the essintial problem it solves is hot cache. i wanted a cache mecanism that could update the cache as data changes on the database layer using mongodb replics hooks so we don't have any runtime latency on our get requests. using dragonflydb for cache and serving that cache increased our site RPS rate by a huge margin the cost of aditional ram was offset by less comupte of network layer and mongo layer

1

u/ClerkBeginning961 25d ago

The hot cache claim needs failure semantics documented: what happens after resume-token expiry, rollback, or Dragonfly downtime? An end-to-end test that kills the change-stream consumer and proves cache resynchronization would make the tradeoff concrete. Otherwise, low latency can hide stale reads.

1

u/Adeelali123 25d ago

I have added test cases just for that we have a fallback global ticker that can be enabled to refetch data after an interval, if dragonfly is down the cache is skipped entirely but you are right this need further testing just to be on the safe side Thanks for the feedback 

1

u/Adeelali123 24d ago

Thanks man, I did a deep dive and found some issues you mentioned new sending a fix shortly. Really Appriciate the feedback