Main Page: Difference between revisions

From MemCP
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== πŸš€ Meet MemCP – The MySQL Alternative You've Been Waiting For ==
= MemCP – A Modern In-Memory Columnar Database =
'''Tired of outdated database engines slowing you down?'''


MemCP is a blazing-fast, in-memory, column-oriented database designed for modern workloads. It delivers '''unmatched speed''', '''massive compression''', and '''built-in REST APIs''' – all with a developer-friendly open-source stack.<blockquote>'''Replace MySQL with something better.'''
'''MemCP is a high-performance, in-memory, column-oriented database designed for modern workloads.'''
It provides a lightweight, developer-friendly alternative to traditional relational databases such as MySQL, with a focus on speed, compression, and direct API integration.


Something built for the 2020s – not stuck in 2005.</blockquote>
----
----


=== ⚑ Why Developers Choose MemCP ===
== Key Features ==
βœ… '''Turbocharged Performance'''


Designed for multicore CPUs, modern caches, and NVMe SSDs – MemCP handles analytical (OLAP) and transactional (OLTP) workloads at lightning speed. - read more under [[MySQL is too slow]]
* '''High Performance''': NUMA-aware, parallelized query execution optimized for multicore CPUs, large caches, and NVMe SSDs. Handles both OLTP and OLAP workloads efficiently.Β 
* '''Columnar Storage''': Data is stored by column for improved compression, reduced memory footprint, and faster analytical queries.Β 
* '''In-Memory Operation''': Designed to keep data in memory, with configurable persistence backends for durability.Β 
* '''Built-in APIs''': Exposes RESTful endpoints directly from the database, reducing middleware overhead.Β 
* '''Compression''': Multiple strategies (bit-packing, dictionary encoding, sequence compression) reduce storage by up to 80% compared to MySQL/MariaDB.Β 
* '''Simple Deployment''': Start with a single <code>docker run</code> or <code>pm2 start</code> command. Lightweight footprint (~10MB).Β 
* '''Extensible''': Written in Go, with pluggable storage backends and custom frontend support (SQL, RDF, REST).


βœ… '''80% Smaller Data Footprint'''
----


Columnar storage means smarter compression. Typical use cases shrink data 5Γ— smaller than MySQL – with no effort from your side.
== Why MemCP? ==


βœ… '''Simple JSON APIs Built-in'''
Traditional relational databases were designed decades ago, optimized for spinning disks and single-core CPUs.Β 
MemCP rethinks the core design for today’s hardware and workloads:


Query your data with RESTful endpoints – no middleware, no ORM overhead. Just fast results, directly from the DB.
* Real-time dashboards and analyticsΒ 
* Data-heavy SaaS platformsΒ 
* Embedded systems with limited resourcesΒ 
* High-throughput OLTP/OLAP hybridsΒ 


βœ… '''Familiar SQL-like Structure – Zero Lock-In'''
----


You don’t need to re-learn everything. Tables, schemas, and logic follow familiar patterns – just modernized and optimized.
== Quick Start ==


βœ… '''Zero-Config Installation'''
Clone and build MemCP from source:
Β 
<pre>
git clone https://github.com/launix-de/memcp
cd memcp
go get
make
pm2 start ./memcp ./data/
</pre>
Β 
Connect with MySQL tooling:
Β 
<pre>
mysql -u root -p -P 3307
Enter password: admin
</pre>


Spin up MemCP with a single <code>docker run</code> or <code>pm2 start</code>. Start building in minutes.
----
----


=== πŸ§‘β€πŸ’» Built for Developers, by Developers ===
== MemCP vs. MySQL ==
MemCP was made for the people who write real-world code, not just benchmark reports. Whether you're building a SaaS product, IoT platform, or data-heavy analytics dashboard, MemCP gives you the speed and flexibility you need to scale.


# Ready to try it?
git clone <nowiki>https://github.com/launix-de/memcp</nowiki>
cd memcp
go get
make
pm2 start ./memcp ./data/
mysql -u root -p -P 3307
Enter password: admin
=== πŸ†š MemCP vs MySQL: The Key Differences ===
{| class="wikitable"
{| class="wikitable"
!Feature
! Feature
!MySQL
! MySQL
!MemCP
! MemCP
|-
|-
|Storage Model
| Storage Model
|Row-based
| Row-based
|Column-based (compressed)
| Column-based (compressed)
|-
|-
|Performance
| Performance
|Good
| Good
|Excellent (NUMA-optimized)
| NUMA-optimized, in-memory
|-
|-
|In-Memory Capable
| In-Memory Capable
|Limited
| Limited
|Yes, by default
| Yes (default)
|-
|-
|REST API Integration
| REST API Integration
|External services
| External
|Built-in
| Built-in
|-
|-
|Installation Footprint
| Installation Footprint
|~150MB+
| ~150MB+
|~10MB
| ~10MB
|-
|-
|Open Source
| Open Source
|βœ…
| βœ…
|βœ…
| βœ…
|}
|}


=== πŸ’‘ Ideal Use Cases ===
----
Β 
* High-speed dashboards & real-time analytics
* Embedded systems with minimal resources
* Data-heavy SaaS backends
* Replacing outdated MySQL deployments with modern performance


== Architecture Overview ==


=== πŸ§ͺ Try MemCP Today ===
* '''Tables, Schemas, Columns''': Familiar SQL-style structures with a columnar physical layout.Β 
Explore the documentation, check out the GitHub repo, and join a growing community of developers building fast, efficient, modern systems with MemCP.<blockquote>Ditch the legacy. Embrace performance.
* '''Transaction Model''': Supports both OLTP and OLAP semantics with delta + main storage.Β 
* '''Persistence''': Configurable storage backends (filesystem, S3, Ceph).
* '''Frontends''': Multiple query interfaces:
Β  - SQL frontend (MySQL wire protocol + SQL over REST)Β 
Β  - RDF/graph query engineΒ 
Β  - Custom APIs via in-database web appsΒ 


'''Make the switch to MemCP.'''</blockquote>
----
----


=== What is memcp? ===
== Documentation ==
[[File:Webapps.svg|left|frameless]]
memcp is an open-source, high-performance, columnar in-memory database that can handle both OLAP and OLTP workloads. It provides an alternative to proprietary analytical databases and aims to bring the benefits of columnar storage to the open-source world.


memcp is written in Golang and is designed to be portable and extensible, allowing developers to embed the database into their applications with ease. It is also designed with a focus on scalability and performance, making it a suitable choice for distributed applications.
* [[What is OLTP and OLAP]]Β 
* [[History of the MemCP project]]Β 
* [[Hardware Requirements]]Β 
* [[Persistency and Performance Guarantees]]Β 
* [[Comparison: MemCP vs. MySQL]]Β 
* [[Install MemCP with Docker|Install with Docker]]Β 
* [[Compile MemCP from Source|Build from Source]]Β 
* [[Contributing]]Β 
* [[SQL over REST]]Β 
* [[In-Database WebApps|REST & Microservices]]Β 


----


===Features===
== Further Reading ==


*'''fast:''' MemCP is built with parallelization in mind. The parallelization pattern is made for minimal overhead.
* [https://github.org/launix-de/memcp MemCP on GitHub]Β 
*'''efficient:''' The average compression ratio is 1:5 (80% memory saving) compared to MySQL/MariaDB
* [https://www.vldb.org/pvldb/vol13/p2649-boncz.pdf VLDB Research Paper]Β 
*'''modern:''' MemCP is built for modern hardware with caches, NUMA memory, multicore CPUs, NVMe SSDs
* [https://cs.emis.de/LNI/Proceedings/Proceedings241/383.pdf LNI Proceedings Paper]Β 
* '''versatile:''' Use it in big mainframes to gain analytical performance, use it in embedded systems to conserve flash lifetime
* [https://www.dcs.bbk.ac.uk/~dell/teaching/cc/paper/sigmod10/p135-malewicz.pdf Large Graph Algorithms]
* Columnar storage: Stores data column-wise instead of row-wise, which allows for better compression, faster query execution, and more efficient use of memory.
* In-memory database: Stores all data in memory, which allows for extremely fast query execution.
*Build fast REST APIs directly in the database (they are faster because there is no network connection / SQL layer in between)
*OLAP and OLTP support: Can handle both online analytical processing (OLAP) and online transaction processing (OLTP) workloads.
*Compression: Lots of compression formats are supported like bit-packing and dictionary encoding
* Scalability: Designed to scale on a single node with huge NUMA memory
*Adjustable persistency: Decide whether you want to persist a table or not or to just keep snapshots of a period of time
[[File:MemCP Port.png|frameless]]


<youtube>g29FR4Jwius</youtube>
Additional blog posts on design decisions, compression techniques, and performance optimization are available on the [https://launix.de/launix/ Launix blog].


https://www.youtube.com/watch?v=g29FR4Jwius
----
Β 
===Navigation===
Β 
====Introduction====
*[[What is OLTP and OLAP]]
*[[History of the MemCP project]]
*[[Hardware Requirements]]
*[[Persistency and Performance Guarantees]]
*[[Current Status and Open Issues]]
*[[Comparison: MemCP vs. MySQL]]
Β 
====Getting Started====
*[[Install MemCP with Docker|With Docker]]
*[[With Singularity]]
*[[Compile MemCP from Source|Build from Source]]
*[[Contributing]]
*[[Introduction to Scheme]]
*[[Full SCM API documentation]]
Β 
====Administration====
Β 
* [[Deployment]]
* [[Migration from MySQL and PostgreSQL]]
* [[Settings]]
*[[Process Hibernation]]
*[[Performance Measurement]]
*[[MemCP Console]]
Β 
====Frontends====
Β 
=====SQL Frontend=====
*[[Supported SQL]]
*[[Advanced SQL Tutorial]]
*[[SQL over REST]]
*[[Database Tools compatibility with MemCP|Supported Tooling]]
*[[How SQL Operators are implemented on MemCP]]
*[[Add custom SQL operators to MemCP]]
Β 
=====RDF Frontend=====
*[[Introduction to RDF]]
*[[Advanced Graph Querying]]
*[[RDF templating and model driven development]]
Β 
=====Custom Frontends=====
Β 
*[[In-Database WebApps|In-Database WebApps and REST Services]]
*[[MemCP for Microservices]]
*[[Websockets in MemCP]]
Β 
==== Persistency Backends (= Storage) ====
Β 
* [[File System]]
* [[S3 Buckets]]
* [[Ceph/Rados]]
* [[Cluster Monitor]]
Β 
====Internals====
Β 
=====How things work in MemCP=====
Β 
*[[Databases, Tables and Columns]]
*[[Shards, RecordIDs, Main Storage, Delta Storage]]
*[[Columnar Storage]]
*[[Transactions]]
*[[Full SCM API documentation]]
Β 
===== SCM Documentation =====
Β 
* [[SCM Builtins]]
* [[Arithmetic / Logic]]
* [[Strings]]
* [[Streams]]
* [[Lists]]
* [[Associative Lists / Dictionaries]]
* [[Date]]
* [[Vectors]]
* [[Parsers]]
* [[Sync]]
* [[IO]]
* [[Storage]]
Β 
=====Optimizations=====
*[[In-Memory Compression, Columnar Compression Techniques]]
*[[Temporary Columns]]
*[[Data Auto Sharding and Auto Indexing]]
* [[Parallel Computing]]
Β 
Β 
[[File:Screenshot from htop.png|center|frameless|2490x2490px]]
Β 
Β 
===Further Reading===
[https://github.org/launix-de/memcp MemCP on Github]
Β 
====Scientific====


*[https://www.vldb.org/pvldb/vol13/p2649-boncz.pdf VLDB Research Paper]
== Community ==
*[https://cs.emis.de/LNI/Proceedings/Proceedings241/383.pdf LNI Proceedings Paper]
*[https://wwwdb.inf.tu-dresden.de/wp-content/uploads/T_2014_Master_Patrick_Damme.pdf TU Dresden Research Paper]
*[https://www.dcs.bbk.ac.uk/~dell/teaching/cc/paper/sigmod10/p135-malewicz.pdf Large Graph Algorithms]
*https://wwwdb.inf.tu-dresden.de/research-projects/eris/


====How MemCP was built====
MemCP is an open-source project maintained by developers for developers.Β 
Contributions are welcome β€” whether in the form of bug reports, feature requests, or pull requests.Β 


*[https://launix.de/launix/how-to-balance-a-database-between-olap-and-oltp-workflows/ Balancing OLAP and OLTP Workflows]
See: [[Contributing]]
*[https://launix.de/launix/designing-a-programming-language-for-distributed-systems-and-highly-parallel-algorithms/ Designing Programming Languages for Distributed Systems]
*[https://launix.de/launix/on-designing-an-interface-for-columnar-in-memory-storage-in-golang/ Columnar Storage Interface in Golang]
*[https://launix.de/launix/how-in-memory-compression-affects-performance/ Impact of In-Memory Compression on Performance]
*[https://launix.de/launix/memory-efficient-indices-for-in-memory-storages/ Memory-Efficient Indices for In-Memory Storages]
*[https://launix.de/launix/on-compressing-null-values-in-bit-compressed-integer-storages/ Compressing Null Values in Bit-Compressed Integer Storages]
*[https://launix.de/launix/when-the-benchmark-is-too-slow-golang-http-server-performance/ Improving Golang HTTP Server Performance]
*[https://launix.de/launix/how-to-benchmark-a-sql-database/ Benchmarking SQL Databases]
*[https://launix.de/launix/writing-a-sql-parser-in-scheme/ Writing a SQL Parser in Scheme]
*[https://launix.de/launix/accessing-memcp-via-scheme/ Accessing memcp via Scheme]
*[https://launix.de/launix/memcp-first-sql-query-is-correctly-executed/ First SQL Query in memcp]
*[https://launix.de/launix/sequence-compression-in-in-memory-database-yields-99-memory-savings-and-a-total-of-13/ Sequence Compression in In-Memory Database]
*[https://launix.de/launix/storing-a-bit-smaller-than-in-one-bit/ Storing Data Smaller Than One Bit]
*[https://www.youtube.com/watch?v=DWg4nx4KVLo memcp Announcement Video]

Revision as of 13:39, 22 September 2025

MemCP – A Modern In-Memory Columnar Database

MemCP is a high-performance, in-memory, column-oriented database designed for modern workloads. It provides a lightweight, developer-friendly alternative to traditional relational databases such as MySQL, with a focus on speed, compression, and direct API integration.


Key Features

  • High Performance: NUMA-aware, parallelized query execution optimized for multicore CPUs, large caches, and NVMe SSDs. Handles both OLTP and OLAP workloads efficiently.
  • Columnar Storage: Data is stored by column for improved compression, reduced memory footprint, and faster analytical queries.
  • In-Memory Operation: Designed to keep data in memory, with configurable persistence backends for durability.
  • Built-in APIs: Exposes RESTful endpoints directly from the database, reducing middleware overhead.
  • Compression: Multiple strategies (bit-packing, dictionary encoding, sequence compression) reduce storage by up to 80% compared to MySQL/MariaDB.
  • Simple Deployment: Start with a single docker run or pm2 start command. Lightweight footprint (~10MB).
  • Extensible: Written in Go, with pluggable storage backends and custom frontend support (SQL, RDF, REST).

Why MemCP?

Traditional relational databases were designed decades ago, optimized for spinning disks and single-core CPUs. MemCP rethinks the core design for today’s hardware and workloads:

  • Real-time dashboards and analytics
  • Data-heavy SaaS platforms
  • Embedded systems with limited resources
  • High-throughput OLTP/OLAP hybrids

Quick Start

Clone and build MemCP from source:

git clone https://github.com/launix-de/memcp
cd memcp
go get
make
pm2 start ./memcp ./data/

Connect with MySQL tooling:

mysql -u root -p -P 3307
Enter password: admin

MemCP vs. MySQL

Feature MySQL MemCP
Storage Model Row-based Column-based (compressed)
Performance Good NUMA-optimized, in-memory
In-Memory Capable Limited Yes (default)
REST API Integration External Built-in
Installation Footprint ~150MB+ ~10MB
Open Source βœ… βœ…

Architecture Overview

  • Tables, Schemas, Columns: Familiar SQL-style structures with a columnar physical layout.
  • Transaction Model: Supports both OLTP and OLAP semantics with delta + main storage.
  • Persistence: Configurable storage backends (filesystem, S3, Ceph).
  • Frontends: Multiple query interfaces:
 - SQL frontend (MySQL wire protocol + SQL over REST)  
 - RDF/graph query engine  
 - Custom APIs via in-database web apps  

Documentation


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 β€” whether in the form of bug reports, feature requests, or pull requests.

See: Contributing