Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Осипов

CodeFest
January 29, 2018

 Осипов

CodeFest

January 29, 2018
Tweet

More Decks by CodeFest

Other Decks in Programming

Transcript

  1. Содержание • вспоминаем, зачем был нужен NoSQL • что из

    NoSQL выдержало испытание временем • SQL в NoSQL: смотрим на N1QL и CQL. • NoSQL уже мёртв, а NewSQL ещё не рождён: чем тёплый, ламповый SQL отличается от SQL в NoSQL • ищем уникальные ценности NoSQL • изучаем Multi-Model databases и NewSQL
  2. NoSQL tenets • #nosql hashtag • горизонтальное масштабирование • новые

    модели данных • новые модели консистентности NoSQL - выход для фрустрации, тэг который присвоили себе все кому оказалось недостаточно возможностей SQL
  3. Трудности масштабирования Redis Cluster implements all the single key commands

    available in the non-distributed version of Redis. Commands performing complex multi-key operations like Set type unions or intersections are implemented as well as long as the keys all belong to the same node.
  4. JSON в реляционных БД MySQL PostgreSQL Redis Couchbase Cassandra Neo4J

    Хранение JSON Yes Yes Yes Yes Yes Yes! JSON field ops Yes Yes Yes Yes No No JSON query Yes Yes No Yes Yes No JSON secondary index Yes Yes No Yes No No
  5. SQL в NoSQL MongoDB Couchbase Cassandra Redis Cхема данных Yes*

    No Yes No NULLs/Absent values Yes* Yes Yes No JOINs No Yes No No Secondary keys Yes* Yes Yes, but.. No GROUP BY Yes* Yes No No JDBC/ODBC No Yes No No
  6. N1QL: отличия от SQL • NEST/UNNEST • LETTING -> AS

    • IS MISSING -> IS NULL • IS VALUED -> IS NOT UNKNOWN • IN [] -> IN ()
  7. SQL в NoSQL: консистентность Couchbase: Because indexes are by design

    outside the data service, they are eventually consistent with respect to changes to documents and, depending on how you issue the query, may at times not contain the most up-to-date information. This may especially be the case when deployed in a write-heavy environment: changes may take some time to propagate over to the index nodes. Crate.io: Crate does not provide transactions.
  8. Новые языки запросов к данным • RethinkDB ReQL • Elasticsearch

    Query Language ◦ MIN/MAX/AVG ◦ derivative/percentiles/histogram/cumulative sum/serial diff • JSONIQ • GraphQL • SparQL • Pregel -> Сообщество по-прежнему недовольно SQL ! -> потоковая, итеративная парадигма данных вместо реляционной алгебры
  9. UPSERT: зачем это • SQL по своей семантике не содержит

    non-reading update • LSM структуры данных неэффективны для операций чтения • необходим оператор с новой семантикой
  10. После NewSQL: temporal database • time period datatype, including the

    ability to represent time periods with no end (infinity or forever) • the ability to define valid and transaction time period attributes and bitemporal relations • system-maintained transaction time • temporal primary keys, including non-overlapping period constraints • temporal constraints, including non-overlapping uniqueness and referential integrity • update and deletion of temporal records with automatic splitting and coalescing of time periods • temporal queries at current time, time points in the past or future, or over durations • predicates for querying time periods, often based on Allen’s interval relations
  11. После NewSQL: temporal database SELECT * FROM Employee FOR SYSTEM_TIME

    BETWEEN '2014-01-01 00:00:00.0000000' AND '2015-01-01 00:00:00.0000000' WHERE EmployeeID = 1000 ORDER BY ValidFrom;