Storage Size
Understanding Storage Size
This page describes the storage size of documents, document names, fields, and index entries in WorqDB.
String Size
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:
String | Size (bytes) |
---|---|
hello |
5 |
ä½ å¥½ |
6 |
hello ä½ å¥½ |
11 |
hello ä½ å¥½ hello ä½ å¥½ |
22 |
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) |
---|---|
array |
The size of the array is the sum of the sizes of its elements. |
boolean |
1 |
null |
0 |
timestamp |
8 |
number |
8 |
float |
8 |
string |
The size of the string is the number of bytes it takes to store the string in UTF-8 encoding. |
json |
The size of the object is the sum of the sizes of its fields. |
map |
The size of the map is the sum of the sizes of its fields. |
geopoint |
16 |
uuid |
16 |
ip |
4 |
For example, a boolean field named done would use 6 bytes:
- 5 bytes for the
done
field name - 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.