Skip to content

Latest commit

 

History

History
113 lines (81 loc) · 1.9 KB

07-formats.md

File metadata and controls

113 lines (81 loc) · 1.9 KB

Форматы сериализации

bg right fit


SMTP, HTTP, etc

HTTP/1.1 304 Not Modified
Server: nginx
Date: Mon, 31 Oct 2022 06:26:40 GMT
Connection: keep-alive
ETag: "10184-5eb742298960c"

Типичны регулярные грамматики, хорошо парсятся Ragel'eм (не всегда удачно)


XML

с XML всё понятно


JSON

bg right fit

  • {"key":["array","of","values"]}
  • json.org
  • IETF RFCs, ECMA standard

----

JSON is a minefield

bg right fit


Unicode

  • UCS-2
  • UTF-16
  • UTF-8
  • UTF-32

TCP/IP etc

bg right:75% fit

C struct 1:1

----

TLV binary

  1. type
  2. length
  3. value

message Person {
  optional string name = 1;
  optional int32 id = 2;
  optional string email = 3;
}

TLV-like coding


bg right fit

  • there is no spoon
  • Realm

Databases

bg right fit

  • B-Trees
  • Log Structured
    Merge Trees
  • Columnar
  • Datoms (see Fleet)

In vivo

  • BitCoin
  • git
  • BitTorrent