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:

StringSize (bytes)
hello5
你好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 ValueSize (bytes)
arrayThe size of the array is the sum of the sizes of its elements.
boolean1
null0
timestamp8
number8
float8
stringThe size of the string is the number of bytes it takes to store the string in UTF-8 encoding.
jsonThe size of the object is the sum of the sizes of its fields.
mapThe size of the map is the sum of the sizes of its fields.
geopoint16
uuid16
ip4

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.