A data type is a classification which describes how data can be created, transformed and used. All programming languages use them, and common examples include integer, string and boolean.
Autonomi provides two native data types for storing and retrieving data: chunk and register. Registers are mutable data types, whereas Chunks are immutable.
Data itself comes in different forms too. Content or binary data is always encrypted and is spread out over the Network as immutable chunks. It can be read by anyone with a data map, which shows how to decrypt and reconstruct the content from its constituent chunks. The data also holds other metadata such as filename and type (video, image, etc). So a 'file' on the Network is really a set of instructions for finding the content's immutable constituent parts and assembling them to recreate the original content, together with information about what will be returned when you do.
A chunk is an immutable data type. Its Network address is derived from the hash of its content. This means the file cannot be edited in any way after it has been uploaded—any change would alter the hash and therefore its address meaning it could not be found. The data chunks are created by self-encryption.
Data deduplication is a unique feature of Autonomi and a side benefit of the process of self-encryption. Two identical chunks will have the same hash value, and therefore only one (plus a few copies for redundancy) need be stored on the Network.
Chunks can be cached by clients, and fetching the same chunk next time can be quicker. Autonomi also has a planned feature called ‘opportunistic caching’ in which more copies of popular data are created closer to where it is being requested.
A register is a general CRDT mutable data type that holds a value. Registers are used to store appendable data—data can be added to a register with previous values still being accessible.
Autonomi deploys a special type of register called a Merkle register which supports concurrent writes. If two actors write to a register at the same time a fork will be created with both versions kept available. It's then up to client software to decide which fork to choose, according to the app's own rules.