# What’s Really New with NewSQL?

## What’s Really New with NewSQL?

### 引言

#### New Architectures

Managing their own storage also enables a DBMS to employ more sophisticated replication schemes than what is possible with the block-based replication scheme used in HDFS. In general, it allows these DBMSs to achieve better performance than other systems that are layered on top of other existing technologies; examples of this include the “SQL on Hadoop” systems like Trafodion and Splice Machine that provide transactions on top of Hbase. As such, we believe that such systems should not be considered NewSQL.


Clustrix , CockroachDB, Google Spanner, H-Store, HyPer, MemSQL, NuoDB, SAP HANA, VoltDB.


#### Transparent Sharding Middleware

 AgilData Scalable Cluster 2, MariaDB MaxScale, ScaleArc, ScaleBase3.


#### Database-as-a-Service

 As in most aspects of cloud computing, the largest companies are the major players in the DBaaS field due to the economies of scale. But almost all of the DBaaSs just provide a managed instance of a traditional, single-node DBMS.


Amazon Aurora, ClearDB.


### 最新技术

#### Partitioning / Sharding & Concurrency Control

All of the middleware and DBaaS services inherit the con- currency control scheme of their underlying DBMS architec- ture; since most of them use MySQL, this makes them 2PL with MVCC systems.


In general, we find that there is nothing significantly new about the core concurrency control schemes in NewSQL systems other than laudable engineering to make these algorithms work well in the context of modern hardware and distributed operating environments.


#### Secondary Indexes

• 在哪里保存这些次级索引；
• 如何维持这些索引；

 In a system with a centralized coordinator, like with sharding middleware, secondary indexes can reside on both the coordinator node and the shard nodes. The advantage of this approach is that there is only a single version of the index in the entire system, and thus it is easier to maintain.


An example of a decentralized secondary index that mixes both of these concepts is in Clustrix. The DBMS first maintains a replicated, coarse-grained (i.e., range-based) index at each node that maps values to partitions. This mapping allows the DBMS to route queries to the appropriate node using an attribute that is not the table’s partitioning attribute. These queries will then access a second partitioned index at that node that maps exact values to tuples.


#### Replication & Crash Recovery

The first is how the DBMS enforces data consistency across nodes. In a strongly consistent DBMS, a transaction’s writes must be acknowledged and installed at all replicas before that transaction is considered committed (i.e., durable).
...
which has additional overhead and can lead to stalls if a node fails or if there is a network partition/delay. This is why NoSQL systems opt for a weakly consistent model (also called eventual consistency) where not all replicas have to acknowledge a modification before the DBMS notifies the application that the write succeeded.


Most NewSQL DBMSs implement this second approach because they use a non-deterministic concurrency control scheme. This means that they cannot send queries to replicas as they arrive on the master because they may get executed in a different order on the replicas and the state of the databases will diverge at each replica. This is because their execution order depends on several factors, including network delays, cache stalls, and clock skew.


### 总结

More long term, we believe that there will be a convergence of features in the four classes of systems that we discussed here:
(1) the older DBMSs from the 1980-1990s,
(2) the OLAP data warehouses from the 2000s,
(3) the NoSQL DBMSs from the 2000s, and
(4) the NewSQL DBMSs from the 2010s.
We expect that all of the key systems in these groups will support some form of the relational model and SQL (if they do not already), as well as both OLTP operations and OLAP queries together like HTAP DBMSs. When this occurs, such labels will be meaningless.


## 参考

1. What’s Really New with NewSQL? SIGMOD Record, June 2016 (Vol. 45, No. 2).