Closed thedodd closed 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?
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.
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!
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).
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.
initial refactor
wither
deep-diff indices (#30).Punting on this for now, as index management is still a WIP in the driver as of0.11
.wither_derive
read_concern
attribute.selection_criteria
. Just using fn path for now.outstanding issues
async driver
wither
mongodb@0.11
&bson@0.15
.sync
feature which passes through tomongodb/sync
.sync
module.ModelSync
for deriving the sync version of a model. Code should be nearly identical.docs
read_concern
.skip_serde_checks
now based on word, not bool KV.write_concern
acknowledgement docs. Need to discuss enum issues, same as for read concern.selection_critiera
needs to be a function path. This is essentially an escape hatch. May update the in future.index
es are now derived very differently.Closes #30 Closes #31 Closes #33 Closes #35 Closes #36 Closes #42 Closes #50