This is documentation for MapR Version 5.0. You can also refer to MapR documentation for the latest release.

Skip to end of metadata
Go to start of metadata

Like Apache HBase, MapR-DB stores structured data as a nested series of maps. Each map consists of a set of key-value pairs, where the value can be the key in another map. Keys are kept in strict lexicographical order: 1, 10, and 113 come before 2, 20, and 213.

In descending order of granularity, the elements of a table are:

  • Key: Keys identify the rows in a table.
    In MapR-DB, the maximum supported size of a row key is 64 KB. However, the recommended practice is to keep it lower than a few hundred bytes.
  • Row: Rows span one or more column families and columns. 
    In MapR-DB, the maximum supported size of a row is 2 GB. However, the recommended practice is to keep the size under 2 MB. In general, MapR-DB performs better with many small rows, rather than with fewer very large rows.
  • Column family: A column family is a key associated with a set of columns. Specify this association according to your individual use case, creating sets of columns. A column family can contain an arbitrary number of columns. MapR-DB tables support up to 64 column families.
  • Column: Columns are keys that are associated with a series of timestamps that define when the value in that column was updated.
  • Timestamp: The timestamp in a column specifies a particular data write to that column.
  • Value: The data written to that column at the specific timestamp.

This structure results in versioned values that you can access flexibly and quickly. Because Apache HBase and MapR-DB tables are sparse, any of the column values for a given key can be null.

Example table

This example uses JSON notation for representational clarity. In this example, timestamps are arbitrarily assigned.

 Expand this section to see the JSON code sample.

Queries return the most recent timestamp by default. A query for the value in "arbitrarySecondKey"/"secondColumnFamily:firstColumn" returns valueThree. Specifying a timestamp with a query for "arbitrarySecondKey"/"secondColumnFamily:firstColumn"/11 returns valueSeven.

  • No labels