thedodd / wither

An ODM for MongoDB built on the official MongoDB Rust driver.
https://docs.rs/wither
Other
325 stars 40 forks source link

Cut over to the new driver. #48

Closed thedodd closed 4 years ago

thedodd commented 4 years ago

initial refactor

wither

wither_derive

outstanding issues

async driver

wither

docs


Closes #30 Closes #31 Closes #33 Closes #35 Closes #36 Closes #42 Closes #50

thedodd commented 4 years ago

@saghm qq, given that index management has not landed in the underlying driver as of 0.11, and given that Wither has always had the index syncing capabilities, I am considering implementing some code which wraps the Database::run_command method to list indexes as well as a few other commands. All with the end goal of being able to do effective index syncing.

Do you think there is value in going down that path right now? Or is the mongo team about to land some changes in the driver which implement the index management interfaces?

saghm commented 4 years ago

We've gotten quite a few questions about index management over the past couple of months. We tend to consider it somewhat of an antipattern to manage indexes from within the application, but it seems like we may have underestimated the demand for it. That being said, I'm not sure how soon we'll be able to prioritize working on it, as we have a number of other major features we want to add after our 1.0 release next week (retryable writes, transactions, etc.).

If you're already considering adding wrappers around the driver for index management, maybe what makes the most sense is for you to make a pull request to the driver implementing it. The trickiest part about that is that the drivers team has a specification for index management, so any implementation in the Rust driver would have to conform to that. If you're willing to take a stab at implementing that, I can definitely point you in the right direction in terms of what parts of the driver to look at and answer any questions you have during development.

thedodd commented 4 years ago

Ok @saghm @losintikfos (and anyone else following along) now that the primary refactor of this crate is finished (new driver, new types &c), I've outlined a few items above for the next phase of this effort (outlined above, under the async driver heading).

From there, I'm planning on waiting for feedback from users on how badly they feel they need app level index syncing (schema migrations are lumped in with that as well). Depending on how folks feel about it, we can just de-prioritize index management, or make it a major item of focus.

Thanks for all of the feedback so far!

thedodd commented 4 years ago

Also, FWIW, that index management spec is pretty light weight. If I have the time, I wouldn't mind knock out an implementation of the Standard API (which is roughly what the old driver had).

thedodd commented 4 years ago

Ok. Code complete. Just need to finish up docs, changelog, release notes and such, then time for an alpha release.

Async tests & derive are working nicely.

Sync tests & derive are working nicely.