Main Page: Difference between revisions
No edit summary |
Wikiservice (talk | contribs) (Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference) |
||
| Line 1: | Line 1: | ||
= MemCP – | <!-- Copyright (C) 2026 Carl-Philip Haensch --> | ||
<!-- SPDX-License-Identifier: GPL-3.0-or-later --> | |||
= MemCP Database – Fast, Compressed SQL for OLTP and OLAP = | |||
<div style="padding:2.5rem 2rem; margin:0 0 1.5rem; border-radius:14px; background:linear-gradient(135deg,#3d6208 0%,#64910c 52%,#76b512 100%); color:#fff; text-align:center;"> | <div style="padding:2.5rem 2rem; margin:0 0 1.5rem; border-radius:14px; background:linear-gradient(135deg,#3d6208 0%,#64910c 52%,#76b512 100%); color:#fff; text-align:center;"> | ||
<div style="font-size:2.6rem; line-height:1.1; font-weight:700; margin-bottom:.7rem;">MemCP</div> | <div style="font-size:2.6rem; line-height:1.1; font-weight:700; margin-bottom:.7rem;">MemCP</div> | ||
<div style="font-size:1.45rem; line-height:1.35; font-weight:600; margin:0 auto .9rem; max-width:56rem;">A fast, compressed, MySQL-compatible columnar database for modern OLTP and OLAP workloads</div> | <div style="font-size:1.45rem; line-height:1.35; font-weight:600; margin:0 auto .9rem; max-width:56rem;">A fast, compressed, MySQL-protocol-compatible columnar database for modern OLTP and OLAP workloads</div> | ||
<div style="font-size:1.05rem; line-height:1.6; margin:0 auto 1.4rem; max-width:54rem;">MemCP combines persistent in-memory operation, adaptive column compression, parallel query execution and direct application APIs | <div style="font-size:1.05rem; line-height:1.6; margin:0 auto 1.4rem; max-width:54rem;">MemCP is an open-source SQL database written in Go. It combines persistent in-memory operation, adaptive column compression, parallel query execution and direct application APIs so operational data can be queried and analyzed without maintaining a separate analytical copy.</div> | ||
<div style="margin-bottom:1.5rem;"><span style="display:inline-block; padding:.2rem .65rem; margin:.15rem; border:1px solid #ffffff88; border-radius:1rem;">Beta</span> <span style="display:inline-block; padding:.2rem .65rem; margin:.15rem; border:1px solid #ffffff88; border-radius:1rem;">Open Source</span> <span style="display:inline-block; padding:.2rem .65rem; margin:.15rem; border:1px solid #ffffff88; border-radius:1rem;">MySQL Protocol + HTTP APIs</span></div> | <div style="margin-bottom:1.5rem;"><span style="display:inline-block; padding:.2rem .65rem; margin:.15rem; border:1px solid #ffffff88; border-radius:1rem;">Beta</span> <span style="display:inline-block; padding:.2rem .65rem; margin:.15rem; border:1px solid #ffffff88; border-radius:1rem;">Open Source</span> <span style="display:inline-block; padding:.2rem .65rem; margin:.15rem; border:1px solid #ffffff88; border-radius:1rem;">MySQL Protocol + HTTP APIs</span></div> | ||
<div class="plainlinks"><span style="display:inline-block; margin:.25rem;">[[Install MemCP with Docker|<span style="display:inline-block; padding:.65rem 1rem; border-radius:6px; background:#fff; color:#496f0c; font-weight:700;">Get started with Docker</span>]]</span> <span style="display:inline-block; margin:.25rem;">[[Supported SQL|<span style="display:inline-block; padding:.65rem 1rem; border:1px solid #fff; border-radius:6px; color:#fff; font-weight:700;">Explore SQL support</span>]]</span> <span style="display:inline-block; margin:.25rem;">[https://github.com/launix-de/memcp <span style="display:inline-block; padding:.65rem 1rem; border:1px solid #fff; border-radius:6px; color:#fff; font-weight:700;">View on GitHub</span>]</span></div> | <div class="plainlinks"><span style="display:inline-block; margin:.25rem;">[[Install MemCP with Docker|<span style="display:inline-block; padding:.65rem 1rem; border-radius:6px; background:#fff; color:#496f0c; font-weight:700;">Get started with Docker</span>]]</span> <span style="display:inline-block; margin:.25rem;">[[Supported SQL|<span style="display:inline-block; padding:.65rem 1rem; border:1px solid #fff; border-radius:6px; color:#fff; font-weight:700;">Explore SQL support</span>]]</span> <span style="display:inline-block; margin:.25rem;">[https://github.com/launix-de/memcp <span style="display:inline-block; padding:.65rem 1rem; border:1px solid #fff; border-radius:6px; color:#fff; font-weight:700;">View on GitHub</span>]</span></div> | ||
| Line 13: | Line 16: | ||
<div style="padding:.85rem 1rem; margin:1rem 0 2rem; border-left:5px solid #d99b00; background:#fff7d6; color:#332600;"> | <div style="padding:.85rem 1rem; margin:1rem 0 2rem; border-left:5px solid #d99b00; background:#fff7d6; color:#332600;"> | ||
'''Development status: Beta.''' MemCP is under active development. Check [[Supported SQL]], [[Current Status and Open Issues]] and the durability requirements of your workload before migrating production data. | '''Development status: Beta.''' MemCP is under active development. Check [[Supported SQL]], [[Current Status and Open Issues]] and the durability requirements of your workload before migrating production data. | ||
</div> | |||
<div style="padding:1rem 1.15rem; margin:1rem 0 2rem; border-left:5px solid #76b512; background:#f5f8f0; color:#17202a;"> | |||
'''Your MySQL queries are too slow?''' Run the same representative workload on MemCP instead of assuming another index or a larger MySQL server is the only answer. Compare results, durability and authenticated end-to-end latency; if the migration gates pass, move the performance-critical workload to MemCP. [[MySQL is too slow|Start the MemCP performance evaluation →]] | |||
</div> | |||
<div style="padding:1rem 1.15rem; margin:1rem 0 2rem; border:1px solid #b7c99a; border-radius:9px; background:#f5f8f0; color:#17202a;"> | |||
'''Observed performance profile:''' MemCP has achieved '''up to 10× the performance of MariaDB/PostgreSQL''' in OLAP and search-oriented workflows, where RecSets and compressed column scans avoid wide row materialization. Isolated OLTP paths currently take about '''1.3–2.0× as long''', but in complete WordPress- and wiki-style page builds this has made '''no significant difference to overall page-loading time''' in the measured application workflows. Filtered-list queries over roughly one million documents, by contrast, have taken around '''30 seconds on PostgreSQL'''. These are workload observations, not universal guarantees; [[Performance Measurement|reproduce them on your data]]. | |||
</div> | |||
== What is MemCP? == | |||
'''MemCP Database''' is a persistent, compressed, column-oriented SQL database for mixed OLTP and OLAP workloads. It speaks the MySQL client protocol, also exposes SQL over HTTP, and executes supported queries through a functional compiler and a parallel column-storage engine. | |||
The name on this site refers to the database project. MemCP Database is '''not''' a Model Context Protocol (MCP) memory server and is unrelated to the C/C++ <code>memcpy()</code> memory-copy function. When writing about or linking to the project, the unambiguous name is '''MemCP Database'''. | |||
== Problems MemCP solves == | |||
<div style="display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:1rem; margin:1rem 0 2rem;"> | |||
<div style="padding:1rem 1.1rem; border:1px solid #b7c99a; border-radius:9px;"> | |||
<div style="font-size:1.1rem; font-weight:700; margin-bottom:.4rem;">Slow filtered lists on millions of rows</div> | |||
Complex <code>WHERE</code>, joins, membership tests, <code>ORDER BY</code> and <code>LIMIT</code> can make a row store inspect or materialize far more data than the page returns. MemCP uses RecSets, late materialization, adaptive indexes and ordered braking to keep the working domain compact.<br />[[MySQL is too slow|Evaluate the query]] · [[RecSets|How RecSets work]] | |||
</div> | |||
<div style="padding:1rem 1.1rem; border:1px solid #b7c99a; border-radius:9px;"> | |||
<div style="font-size:1.1rem; font-weight:700; margin-bottom:.4rem;">Slow GROUP BY, COUNT and dashboards</div> | |||
Column scans read only referenced compressed values. Parallel shard-local aggregation, group caches and computed structures target repeated analytical queries over fresh operational data.<br />[[Columnar Storage]] · [[Temporary Computed Columns]] | |||
</div> | |||
<div style="padding:1rem 1.1rem; border:1px solid #b7c99a; border-radius:9px;"> | |||
<div style="font-size:1.1rem; font-weight:700; margin-bottom:.4rem;">Slow database writes caused by fsync</div> | |||
Durability is selectable per table. <code>safe</code> protects commits through power loss; <code>logged</code> has measured about 10× its write throughput when process-crash recovery is sufficient.<br />[[Persistency and Performance Guarantees|Choose a write strategy]] | |||
</div> | |||
<div style="padding:1rem 1.1rem; border:1px solid #b7c99a; border-radius:9px;"> | |||
<div style="font-size:1.1rem; font-weight:700; margin-bottom:.4rem;">Database writes wear out an SD card</div> | |||
For reconstructible edge data, <code>sloppy</code> avoids a continuous WAL and normally publishes one compressed generation every 15 minutes, reducing constant flash writes while making the loss window explicit.<br />[[Hardware Requirements]] · [[Persistency and Performance Guarantees]] | |||
</div> | |||
</div> | </div> | ||
| Line 40: | Line 78: | ||
Explore the storage engine, optimizer, embedded Scheme runtime and project internals. | Explore the storage engine, optimizer, embedded Scheme runtime and project internals. | ||
[[Query Planner and Physical Lowering|Query planner]] · [[Columnar Storage]] · [[Contributing]] | [[Query Planner and Physical Lowering|Query planner]] · [[RecSets]] · [[Columnar Storage]] · [[Contributing]] | ||
</div> | </div> | ||
</div> | </div> | ||
| Line 52: | Line 90: | ||
-e ROOT_PASSWORD='choose-a-password' \ | -e ROOT_PASSWORD='choose-a-password' \ | ||
-p 4321:4321 -p 3307:3307 \ | -p 4321:4321 -p 3307:3307 \ | ||
-v memcp-data:/data \ | |||
carli2/memcp:latest | carli2/memcp:latest | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Then open <code>http://localhost:4321</code> and connect a MySQL application to <code>127.0.0.1</code> on port '''3307'''. | Then open <code>http://localhost:4321</code> and connect a MySQL application to <code>127.0.0.1</code> on port '''3307'''. The volume mounted at <code>/data</code> retains persistent table data across container replacement. See [[Install MemCP with Docker|the complete Docker guide]] before deploying it as a service. | ||
=== Build from source === | === Build from source === | ||
| Line 86: | Line 125: | ||
<div style="display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:.8rem; margin:1rem 0;"> | <div style="display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:.8rem; margin:1rem 0;"> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''High performance'''<br /> | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''High performance'''<br />Parallel, batch-oriented query execution is designed for multicore CPUs, compact working sets and fast persistent storage, serving both OLTP and OLAP workloads.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Columnar storage'''<br />Data is stored by column for improved compression, a smaller memory footprint and fast analytical access.</div> | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Columnar storage'''<br />Data is stored by column for improved compression, a smaller memory footprint and fast analytical access.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Persistent in-memory operation'''<br />MemCP is designed to keep active data in memory while offering configurable per-table durability and persistence backends.</div> | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Persistent in-memory operation'''<br />MemCP is designed to keep active data in memory while offering configurable per-table durability and persistence backends.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Fast configurable writes'''<br />Choose durability per table: <code>safe</code> protects committed data through power loss, while measured <code>logged</code> paths have reached about 10× its write throughput; <code>sloppy</code> batches reconstructible data into the normal 15-minute rebuild cycle.</div> | |||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Built-in APIs'''<br />SQL over HTTP and in-database services can remove an extra middleware hop for suitable applications.</div> | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Built-in APIs'''<br />SQL over HTTP and in-database services can remove an extra middleware hop for suitable applications.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Adaptive compression'''<br />Bit-packing, dictionary encoding and sequence compression | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Adaptive compression'''<br />Bit-packing, dictionary encoding and sequence compression reduce the bytes read for suitable data. Historical imports have reached reductions around 80% versus their MySQL/MariaDB representation; measure your own schema.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Simple deployment'''<br />Start with Docker, PM2 or the native binary. The compact application has historically had an installation footprint of approximately 10 MB.</div> | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Simple deployment'''<br />Start with Docker, PM2 or the native binary. The compact application has historically had an installation footprint of approximately 10 MB.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Extensible frontends'''<br />The Go storage engine and embedded Scheme environment support SQL, RDF, REST and custom application interfaces.</div> | <div style="padding:.9rem 1rem; border-top:4px solid #76b512; background:#f5f8f0; color:#17202a;">'''Extensible frontends'''<br />The Go storage engine and embedded Scheme environment support SQL, RDF, REST and custom application interfaces.</div> | ||
<div style="padding:.9rem 1rem; border-top:4px solid #9ad32d; background:#f5f8f0; color:#17202a;">'''Cost-based query execution'''<br />Logical decorrelation and join optimization are separated from cost-based physical selection of scans, indexes, RecSets, reusable caches and execution pipelines.<br />[[Query Planner and Physical Lowering|How MemCP plans and lowers queries →]]</div> | <div style="padding:.9rem 1rem; border-top:4px solid #9ad32d; background:#f5f8f0; color:#17202a;">'''Cost-based query execution'''<br />Logical decorrelation and join optimization are separated from cost-based physical selection of scans, indexes, RecSets, reusable caches and execution pipelines.<br />[[Query Planner and Physical Lowering|How MemCP plans and lowers queries →]] · [[RecSets|How compact record sets process large domains →]]</div> | ||
</div> | </div> | ||
| Line 122: | Line 162: | ||
| Performance focus | | Performance focus | ||
| General-purpose relational workloads | | General-purpose relational workloads | ||
| | | Parallel, in-memory-oriented execution for mixed operational and analytical workloads | ||
|- | |- | ||
| In-memory capability | | In-memory capability | ||
| Line 148: | Line 188: | ||
* '''Transaction model''': Delta and main storage support mixed OLTP and OLAP semantics. See [[Transactions and Isolation]] and [[Shards, RecordIDs, Main Storage, Delta Storage]]. | * '''Transaction model''': Delta and main storage support mixed OLTP and OLAP semantics. See [[Transactions and Isolation]] and [[Shards, RecordIDs, Main Storage, Delta Storage]]. | ||
* '''Query planning''': Logical optimization is separated from physical execution decisions. See [[Query Planner and Physical Lowering]]. | * '''Query planning''': Logical optimization is separated from physical execution decisions. See [[Query Planner and Physical Lowering]]. | ||
* '''Persistence''': Per-table durability can use filesystem, S3 or Ceph/RADOS storage. See [[Persistency and Performance Guarantees]]. | * '''Persistence''': Per-table durability can use filesystem, S3 or Ceph/RADOS storage. See [[Persistency and Performance Guarantees]] and [[Storage Backends]]. | ||
* '''Operations''': The dashboard, metrics, process inspection and memory controls support day-to-day operation. See [[Dashboard and Operations]] and [[Memory Management and Eviction]]. | |||
* '''Scale-out roadmap''': MemCP is single-node today. A leaderless CRUSH/RADOS and MOESI-inspired cluster design is planned, but must not be treated as an available production feature. See [[Cluster Monitor]]. | |||
* '''Frontends''': MemCP provides multiple query and application interfaces: | * '''Frontends''': MemCP provides multiple query and application interfaces: | ||
** SQL through the MySQL wire protocol and SQL over HTTP; | ** SQL through the MySQL wire protocol and SQL over HTTP; | ||
| Line 165: | Line 207: | ||
* [[Persistency and Performance Guarantees]] | * [[Persistency and Performance Guarantees]] | ||
* [[Current Status and Open Issues]] | * [[Current Status and Open Issues]] | ||
* [[MySQL is too slow|SQL performance problems MemCP solves]] | |||
* [[Comparison: MemCP vs. MySQL]] | * [[Comparison: MemCP vs. MySQL]] | ||
| Line 181: | Line 224: | ||
* [[Migration from MySQL and PostgreSQL]] | * [[Migration from MySQL and PostgreSQL]] | ||
* [[Settings]] | * [[Settings]] | ||
* [[Security and Authentication]] | |||
* [[Dashboard and Operations]] | |||
* [[Memory Management and Eviction]] | |||
* [[Process Hibernation]] | * [[Process Hibernation]] | ||
* [[Performance Measurement]] | * [[Performance Measurement]] | ||
| Line 191: | Line 237: | ||
* [[Supported SQL]] | * [[Supported SQL]] | ||
* [[Advanced SQL Tutorial]] | * [[Advanced SQL Tutorial]] | ||
* [[JSON|JSON and SQL/JSON]] | |||
* [[Triggers]] | |||
* [[SQL over REST]] | * [[SQL over REST]] | ||
* [[Database Tools compatibility with MemCP|Supported Tooling]] | * [[Database Tools compatibility with MemCP|Supported Tooling]] | ||
* [[How SQL | * [[Query Planner and Physical Lowering|How SQL operators are implemented]] | ||
* [[Add custom SQL operators to MemCP]] | * [[Add custom SQL operators to MemCP]] | ||
| Line 200: | Line 248: | ||
* [[Introduction to RDF]] | * [[Introduction to RDF]] | ||
* [[Advanced Graph Querying]] | * [[Advanced Graph Querying]] | ||
* [ | * [https://github.com/launix-de/rdfop RDF browser and templating example] | ||
==== Custom frontends ==== | ==== Custom frontends ==== | ||
* [[ | * [[In-Database WebApps and REST Services]] | ||
* [[MemCP for Microservices]] | * [[MemCP for Microservices]] | ||
* [[Websockets in MemCP]] | * [[Websockets in MemCP]] | ||
| Line 211: | Line 259: | ||
* [[File System]] | * [[File System]] | ||
* [[S3 | * [[Storage Backends|S3-compatible and Ceph/RADOS storage]] | ||
* [[Cluster Monitor]] | * [[Cluster Monitor]] | ||
| Line 234: | Line 281: | ||
* [[Lists]] | * [[Lists]] | ||
* [[Associative Lists / Dictionaries]] | * [[Associative Lists / Dictionaries]] | ||
* [[Date]] | * [[Date]] | ||
* [[Vectors]] | * [[Vectors]] | ||
* [[Parsers]] | * [[Parsers]] | ||
| Line 242: | Line 287: | ||
* [[IO]] | * [[IO]] | ||
* [[Storage]] | * [[Storage]] | ||
==== Optimizations ==== | ==== Optimizations ==== | ||
| Line 249: | Line 292: | ||
* [[Query Planner and Physical Lowering]] | * [[Query Planner and Physical Lowering]] | ||
* [[In-Memory Compression, Columnar Compression Techniques]] | * [[In-Memory Compression, Columnar Compression Techniques]] | ||
* [[Temporary Columns]] | * [[Temporary Computed Columns]] | ||
* [[Data Auto Sharding and Auto Indexing]] | * [[Data Auto Sharding and Auto Indexing]] | ||
* [[Parallel Computing]] | * [[Parallel Computing]] | ||
Revision as of 11:59, 28 August 2026
MemCP Database – Fast, Compressed SQL for OLTP and OLAP
Development status: Beta. MemCP is under active development. Check Supported SQL, Current Status and Open Issues and the durability requirements of your workload before migrating production data.
Your MySQL queries are too slow? Run the same representative workload on MemCP instead of assuming another index or a larger MySQL server is the only answer. Compare results, durability and authenticated end-to-end latency; if the migration gates pass, move the performance-critical workload to MemCP. Start the MemCP performance evaluation →
Observed performance profile: MemCP has achieved up to 10× the performance of MariaDB/PostgreSQL in OLAP and search-oriented workflows, where RecSets and compressed column scans avoid wide row materialization. Isolated OLTP paths currently take about 1.3–2.0× as long, but in complete WordPress- and wiki-style page builds this has made no significant difference to overall page-loading time in the measured application workflows. Filtered-list queries over roughly one million documents, by contrast, have taken around 30 seconds on PostgreSQL. These are workload observations, not universal guarantees; reproduce them on your data.
What is MemCP?
MemCP Database is a persistent, compressed, column-oriented SQL database for mixed OLTP and OLAP workloads. It speaks the MySQL client protocol, also exposes SQL over HTTP, and executes supported queries through a functional compiler and a parallel column-storage engine.
The name on this site refers to the database project. MemCP Database is not a Model Context Protocol (MCP) memory server and is unrelated to the C/C++ memcpy() memory-copy function. When writing about or linking to the project, the unambiguous name is MemCP Database.
Problems MemCP solves
Complex WHERE, joins, membership tests, ORDER BY and LIMIT can make a row store inspect or materialize far more data than the page returns. MemCP uses RecSets, late materialization, adaptive indexes and ordered braking to keep the working domain compact.
Evaluate the query · How RecSets work
Column scans read only referenced compressed values. Parallel shard-local aggregation, group caches and computed structures target repeated analytical queries over fresh operational data.
Columnar Storage · Temporary Computed Columns
Durability is selectable per table. safe protects commits through power loss; logged has measured about 10× its write throughput when process-crash recovery is sufficient.
Choose a write strategy
For reconstructible edge data, sloppy avoids a continuous WAL and normally publishes one compressed generation every 15 minutes, reducing constant flash writes while making the loss window explicit.
Hardware Requirements · Persistency and Performance Guarantees
Choose your path
Understand the workload model, current status, hardware needs and differences from MySQL.
Use the MySQL protocol, SQL over HTTP, RDF or application-specific endpoints inside MemCP.
Plan deployment, migration, persistence, storage backends, settings and performance measurement.
Explore the storage engine, optimizer, embedded Scheme runtime and project internals.
Quickstart
Run with Docker
<syntaxhighlight lang="bash"> docker run --name memcp \
-e ROOT_PASSWORD='choose-a-password' \ -p 4321:4321 -p 3307:3307 \ -v memcp-data:/data \ carli2/memcp:latest
</syntaxhighlight>
Then open http://localhost:4321 and connect a MySQL application to 127.0.0.1 on port 3307. The volume mounted at /data retains persistent table data across container replacement. See the complete Docker guide before deploying it as a service.
Build from source
<syntaxhighlight lang="bash"> git clone https://github.com/launix-de/memcp cd memcp go mod download make ./memcp --api-port=4321 --mysql-port=3307 lib/main.scm </syntaxhighlight>
Connect with MySQL tooling:
<syntaxhighlight lang="bash"> mysql -h 127.0.0.1 -u root -p -P 3307
- Enter the password selected for this data directory.
</syntaxhighlight>
The development default for a fresh data directory is admin. Change it before exposing MemCP to another machine. MemCP can also be supervised with PM2:
<syntaxhighlight lang="bash"> pm2 start ./memcp --name memcp -- \
--no-repl -data ./data --api-port=4321 --mysql-port=3307 lib/main.scm
</syntaxhighlight>
Background deployments must use --no-repl so that closing standard input does not terminate the interactive console and stop the server. See Build from Source, Deployment and MemCP Console.
Key features
Parallel, batch-oriented query execution is designed for multicore CPUs, compact working sets and fast persistent storage, serving both OLTP and OLAP workloads.
Data is stored by column for improved compression, a smaller memory footprint and fast analytical access.
MemCP is designed to keep active data in memory while offering configurable per-table durability and persistence backends.
Choose durability per table:
safe protects committed data through power loss, while measured logged paths have reached about 10× its write throughput; sloppy batches reconstructible data into the normal 15-minute rebuild cycle.SQL over HTTP and in-database services can remove an extra middleware hop for suitable applications.
Bit-packing, dictionary encoding and sequence compression reduce the bytes read for suitable data. Historical imports have reached reductions around 80% versus their MySQL/MariaDB representation; measure your own schema.
Start with Docker, PM2 or the native binary. The compact application has historically had an installation footprint of approximately 10 MB.
The Go storage engine and embedded Scheme environment support SQL, RDF, REST and custom application interfaces.
Logical decorrelation and join optimization are separated from cost-based physical selection of scans, indexes, RecSets, reusable caches and execution pipelines.
How MemCP plans and lowers queries → · How compact record sets process large domains →
Why MemCP?
Traditional relational databases were designed around spinning disks and comparatively small numbers of CPU cores. MemCP rethinks storage and query execution for modern multicore systems, large caches, fast storage and mixed workloads.
Typical use cases include:
- real-time dashboards and analytics;
- data-heavy SaaS platforms;
- embedded systems with limited resources;
- high-throughput OLTP/OLAP hybrids.
Whether MemCP is a good fit depends on the required SQL compatibility, durability, query mix, data size and operational environment. Review Supported SQL, Persistency and Performance Guarantees and Performance Measurement rather than treating benchmark figures as universal guarantees.
MemCP vs. MySQL
| Feature | MySQL | MemCP |
|---|---|---|
| Storage model | Primarily row-based | Column-based and compressed |
| Performance focus | General-purpose relational workloads | Parallel, in-memory-oriented execution for mixed operational and analytical workloads |
| In-memory capability | Available through selected engines and caching | Central design goal and default operating model |
| REST API integration | Normally external | Built in |
| Installation footprint | Common server installations are approximately 150 MB or larger | The native application has historically been approximately 10 MB |
| Open source | ✅ | ✅ |
MemCP provides MySQL protocol compatibility but does not claim to implement every MySQL feature. See Comparison: MemCP vs. MySQL for a detailed comparison and Database Tools compatibility with MemCP for client compatibility.
Architecture overview
- Tables, schemas and columns: Familiar SQL structures use a compressed columnar physical layout. See Databases, Tables and Columns and Columnar Storage.
- Transaction model: Delta and main storage support mixed OLTP and OLAP semantics. See Transactions and Isolation and Shards, RecordIDs, Main Storage, Delta Storage.
- Query planning: Logical optimization is separated from physical execution decisions. See Query Planner and Physical Lowering.
- Persistence: Per-table durability can use filesystem, S3 or Ceph/RADOS storage. See Persistency and Performance Guarantees and Storage Backends.
- Operations: The dashboard, metrics, process inspection and memory controls support day-to-day operation. See Dashboard and Operations and Memory Management and Eviction.
- Scale-out roadmap: MemCP is single-node today. A leaderless CRUSH/RADOS and MOESI-inspired cluster design is planned, but must not be treated as an available production feature. See Cluster Monitor.
- Frontends: MemCP provides multiple query and application interfaces:
- SQL through the MySQL wire protocol and SQL over HTTP;
- an RDF/graph query frontend;
- custom APIs through in-database web applications.
Documentation
The following navigation remains on the start page so users and search engines can reach every major documentation area directly.
Introduction and evaluation
- What is OLTP and OLAP
- History of the MemCP project
- Hardware Requirements
- Persistency and Performance Guarantees
- Current Status and Open Issues
- SQL performance problems MemCP solves
- Comparison: MemCP vs. MySQL
Getting started
- Install with Docker
- Install with Singularity/Apptainer
- Build from Source
- Contributing
- Introduction to Scheme
- Full SCM API documentation
Administration
- Deployment
- Migration from MySQL and PostgreSQL
- Settings
- Security and Authentication
- Dashboard and Operations
- Memory Management and Eviction
- Process Hibernation
- Performance Measurement
- MemCP Console
Frontends
SQL frontend
- Supported SQL
- Advanced SQL Tutorial
- JSON and SQL/JSON
- Triggers
- SQL over REST
- Supported Tooling
- How SQL operators are implemented
- Add custom SQL operators to MemCP
RDF frontend
Custom frontends
Persistence backends and storage
Internals
How MemCP works
- Databases, Tables and Columns
- Shards, RecordIDs, Main Storage, Delta Storage
- Columnar Storage
- Transactions and Isolation
- Query Planner and Physical Lowering
- Full SCM API documentation
Scheme documentation
- SCM Builtins
- Arithmetic / Logic
- Strings
- Streams
- Lists
- Associative Lists / Dictionaries
- Date
- Vectors
- Parsers
- Sync
- IO
- Storage
Optimizations
- Query Planner and Physical Lowering
- In-Memory Compression, Columnar Compression Techniques
- Temporary Computed Columns
- Data Auto Sharding and Auto Indexing
- Parallel Computing
Further reading
Additional blog posts on design decisions, compression techniques and performance optimization are available on the Launix blog.
Community
MemCP is an open-source project maintained by developers for developers. Contributions are welcome in the form of bug reports, feature requests and pull requests.
See Contributing and the GitHub repository.