This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
|Initial release||April 23, 2013|
6.8 / August 12, 2019
On April 23, 2013, MemSQL launched its first generally available version of the database to the public. It is a very fast database.
MemSQL combines lock-free data structures and a just-in-time compilation (JIT) to process highly volatile workloads. More specifically, MemSQL implements lock-free hash tables and lock-free skip lists in memory for fast random access to data. SQL queries sent to the MemSQL server are converted into byte code and compiled through LLVM into machine code. Queries are then stripped of their parameters and the query template is stored as a shared object which is subsequently matched against incoming queries to the system. Executing pre-compiled query plans removes interpretation along hot code paths, providing highly efficient code paths that minimize the number of central processing unit (CPU) instructions required to process SQL statements.
MemSQL is wire-compatible with MySQL. This means that applications can connect to MemSQL through MySQL clients and drivers, as well as standard Open Database Connectivity (ODBC) and Java Database Connectivity (JDBC) connectors.
Row and column table formats
MemSQL can store database tables either as rowstores or columnstores. The format used is determined by the user at DDL time (i.e. when the table is created).
Data for all rowstore tables is stored completely in-memory, with snapshots and transaction logs persisted to disk. Data for all columnstore tables is stored on-disk, using a rowstore-like structure to handle incoming inserts into the columnstore.
Rowstore and columnstore tables differ in more than just the storage medium used.
Rowstores, as the name implies, store information in row format, which is the traditional data format used by RDBMS systems. Rowstores are optimized for singleton or small insert, update or delete queries and are most closely associated with OLTP (transactional) use cases.
Columnstores are optimized for complex select queries, typically associated with OLAP (analytics) use cases. As an example, a large clinical data set for data analysis is best stored in columnar format, since queries run against it will typically be ad-hoc queries where aggregates are computed over large numbers of similar data items.
A MemSQL database is a distributed database implemented with aggregators and leaf nodes. MemSQL binaries used for aggregator and leaf nodes are nearly the same, with the only difference being the user identifying the node as an aggregator or leaf. An aggregator is responsible for receiving SQL queries, breaking them up across leaf nodes, and aggregating results back to the client. A leaf node stores MemSQL data and processes queries from the aggregator. All communication between aggregators and leaf nodes is done over the network through SQL syntax. MemSQL uses hash partitioning to distribute data uniformly across the number of leaf nodes.
MemSQL durability is slightly different for its in-memory rowstore and an on-disk columnstore.
Durability for the in-memory rowstore is implemented with a write-ahead log and snapshots, similar to checkpoints. With default settings, as soon as a transaction is acknowledged in memory, the database will asynchronously write the transaction to disk as fast as the disk allows.
The on-disk columnstore is actually fronted by an in-memory rowstore-like structure (skiplist). This structure has the same durability guarantees as the MemSQL rowstore. Apart from that, the columnstore is durable since its data is stored on disk.
A MemSQL cluster can be configured in "High Availability" mode, where every data partition is automatically created with master and slave versions on two separate leaf nodes. In High Availability mode, aggregators send transactions to the master partitions, which then send logs to the slave partitions. In the event of an unexpected master failure, the slave partitions take over as master partitions in a fully online operation.
MemSQL ships with a set of installation, management and monitoring tools called MemSQL Tools. When installing MemSQL, Tools can be used to set up the distributed MemSQL database across machines. MemSQL also provides a telemetry, monitoring, and query GUI called MemSQL Studio. Studio provides information about the running system, and supports browsing schema objects and running queries.
Apache Spark integration
Management and monitoring of running data pipelines can be done within the MemSQL Studio GUI.
- Comparison of relational database management systems
- Comparison of object-relational database management systems
- Database management system
- List of relational database management systems
- List of column-oriented DBMSes
- List of in-memory databases
- List of databases using MVCC
- Tuesday (2012-08-14). "MemSQL Architecture - The Fast (MVCC, InMem, LockFree, CodeGen) and Familiar (SQL)". High Scalability. Retrieved 2019-08-13.
- "MemSQL". Retrieved 2017-09-29.
- Frenkiel, Eric (2013). "MemSQL ships 2.0. Scales in-memory database across hundreds of nodes, thousands of cores" (published 2013-04-23). Retrieved 2013-04-23.
- "Code Generation". docs.memsql.com.
- [dead link]
- "MemSQL - 80,000 queries per second". I-programmer.info. 2012-06-22. Retrieved 2019-08-13.
- "Introduction to MemSQL | DBMS 2 : DataBase Management System Services".
- "Using Durability and Recovery". docs.memsql.com. Retrieved 2018-01-19.
- https://www.reuters.com/article/idUSnMKWDzK5la+1e8+MKW20150924 (press release)