...
1# Driver Library Design
2
3This document outlines the design for this package.
4
5## Deployment, Server, and Connection
6
7Acquiring a `Connection` from a `Server` selected from a `Deployment` enables sending and receiving
8wire messages. A `Deployment` represents an set of MongoDB servers and a `Server` represents a
9member of that set. These three types form the operation execution stack.
10
11### Compression
12
13Compression is handled by Connection type while uncompression is handled automatically by the
14Operation type. This is done because the compressor to use for compressing a wire message is
15chosen by the connection during handshake, while uncompression can be performed without this
16information. This does make the design of compression non-symmetric, but it makes the design simpler
17to implement and more consistent.
18
19## Operation
20
21The `Operation` type handles executing a series of commands using a `Deployment`. For most uses
22`Operation` will only execute a single command, but the main use case for a series of commands is
23batch split write commands, such as insert. The type itself is heavily documented, so reading the
24code and comments together should provide an understanding of how the type works.
25
26This type is not meant to be used directly by callers. Instead a wrapping type should be defined
27using the IDL.
View as plain text