# Data Model

## Schema free

Loglark places almost no restriction on record contents. There are no schema and records can have 
any shape.


## Record parsing

Loglark parses every log record as a json document. If parsing fails,
then the whole record content is interpolated as a json string.

To give a practical example, consider the following cases:

Record with valid json

```
{"name": "foo"}
```

will be parsed as json document

```json
{ "name": "foo" }
```

and record containing non-valid json
```
{"name": "broken
```

will be interpolated as json string

```json
"{\"name\":\"broken"
```


Loglark supports so called **raw-text** mode: treat all log records as
text strings. It is faster, but also limited: no json filters are
supported. Due to limited usefulness it has been disabled. If you want
it anyway, please [write](mailto:support@loglark.io) us


## Faithful representation

Loglark stores records as close as possible to the original JSON
text. Field order and duplicate fields are preserved. Field contents
are kept down to their exact utf-8 representation. The only
normalizations are that all indenting is stripped and redundant
escaping is collapsed: `"\u0041"` becomes `"A"`. Otherwise contents
are exact. Notably, the text representation of numbers stays the same:
`1e10000` remains `1e10000` and will not be converted to `null` or
`Infinity`.
