The size of a string is the number of bytes it takes to store the string in UTF-8 encoding. In UTF-8, each ASCII character (like those in the English alphabet) takes 1 byte to store, while each Chinese character takes 3 bytes. For example, the string
hello consists of 5 ASCII characters, so it takes 5 bytes to store. On the other hand, the string
你好 consists of 2 Chinese characters, so it takes 6 bytes (2 characters * 3 bytes/character) to store.
The following table shows the size of some common strings:
The following are stored as strings in WorqDB:
- Document names
- Field names
- String Field values
- Collection IDs
- String Document IDs
Field Value Size
The size of a field value is the number of bytes it takes to store the value in WorqDB. The following table shows the size of some common field values:
|Field Value||Size (bytes)|
|The size of the array is the sum of the sizes of its elements.|
|The size of the string is the number of bytes it takes to store the string in UTF-8 encoding.|
|The size of the object is the sum of the sizes of its fields.|
|The size of the map is the sum of the sizes of its fields.|
For example, a boolean field named done would use 6 bytes:
- 5 bytes for the
- 1 byte for the boolean value
How we calculate
We charge you in two different ways:
Storage size: The size of the data stored in WorqDB. We run a scan on the Partitioned Container Disc that is assigned to your workspace to identify the size of the data stored in WorqDB. It not only includes the storage for WorqDB, but it takes into account your complete usage of the Partitioned Container Disc. For example, if you have a 100GB Partitioned Container Disc and you are using 50GB for WorqDB and 50GB for other purposes, you will be charged for 100GB of storage.
Data Transfer: The amount of data transferred to and from WorqDB. We keep track of the amount of data transferred to and from WorqDB. This includes the data transferred to and from WorqDB for all operations, including reads, writes, queries, and indexes. This is something that will be also visible in your Workspace Usage Dashboard and Activity Logs. We calculate this by calculating the Payload Size of the request and response. For example, if you are writing a document with a payload size of 100KB, you will be charged for 100KB of data transfer.