Константин Осипов
Tarantool.org
NewSQL: SQL никуда не уходит
1 of 24
Download to read offline
More Related Content
Константин Осипов
1. NewSQL: SQL никуда не
уходит
Константин,
Осипов
Developer http://tarantool.org
2. Содержание
● вспоминаем, зачем был нужен NoSQL
● что из NoSQL выдержало испытание временем
● SQL в NoSQL: смотрим на N1QL и CQL.
● NoSQL уже мёртв, а NewSQL ещё не рождён: чем тёплый, ламповый SQL
отличается от SQL в NoSQL
● ищем уникальные ценности NoSQL
● изучаем Multi-Model databases и NewSQL
3. NoSQL tenets
● #nosql hashtag
● горизонтальное масштабирование
● новые модели данных
● новые модели консистентности
NoSQL - выход для фрустрации, тэг который присвоили себе все кому оказалось
недостаточно возможностей SQL
7. Трудности масштабирования
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.
8. 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
9. NoSQL сегодня
● горизонтальное масштабирование
● новые модели данных document and graph data models
● новые модели консистентности
10. 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
11. N1QL: отличия от SQL
● NEST/UNNEST
● LETTING -> AS
● IS MISSING -> IS NULL
● IS VALUED -> IS NOT UNKNOWN
● IN [] -> IN ()
12. 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.
18. UPSERT: зачем это
● SQL по своей семантике не содержит non-reading update
● LSM структуры данных неэффективны для операций чтения
● необходим оператор с новой семантикой
19. После 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
22. После 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;