-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: BSON, Field Level Encryption, Performance
Use Case
As a node driver user using automatic encryption,
I want the driver's FLE implementation to be efficient and accurate,
So that the performance and accuracy of my application are not impacted.
The state machine, when fetching data keys and listing collections, creates cursors and exhausts them - only to then serialize each document individually back to BSON bytes to feed into libmongocrypt.
This work is unnecessary - if we instead use `{ raw: true }` (or make another internal change to return unserialized documents from cursors), we can feed the output of the cursors directly back into libmongocrypt without an unnecessary deserialization + serialization.
This also circumvents any JS bson deserializer + serializer type issues (such as https://github.com/mongodb/libmongocrypt/commit/d24dd00bde467a1d12288180f889cf51a42e6d7c, for example).
User Experience
Users might see a performance improvement when using auto encryption.
Dependencies
n/a
Risks/Unknowns
n/a
Acceptance Criteria
Implementation Requirements
- When fetching keys and listing collections in the state machine, iterate the resultant cursors of raw bytes instead of deserialized documents and feed the bytes directly into libmongocrypt.
Testing Requirements
- all tests pass.
Documentation Requirements
- none.
Follow Up Requirements
- none.