Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does MySQL or MariaDB have any kind of in-memory database?

I'm working with unit/integration tests and SQLite doesn't support completely certain SQL features (like RIGHT JOIN and FULL OUTER JOIN). Is there any way to work with MySQL (or MariaDB) where the contents of a database are completely stored in memory?

MySQL has MEMORY table engine, however, this table engine still may generate inconsistency in my tests. What I need is some alternative to :memory: from SQLite but with the same features as MySQL.

Edit:

To be more specific, my problem is related to the performance of the unit/integration tests. Several tutorials indicate using SQLite with database in-memory to speed up the testing process, however, some queries in my application aren't compatible with SQLite. I also do not find it a good practice to do the tests in SQLite if the production database is MariaDB.

My question is whether there is any alternative to testing in MySQL/MariaDB that works the same way as the SQLite :memory: option.

like image 641
Victor Otávio Avatar asked Jul 25 '18 16:07

Victor Otávio


People also ask

Is MySQL in memory database?

It does not qualify it as in in-memory database. There are other systems that also offer in-memory options; like SQLite.

How is MariaDB different from MySQL?

MariaDB and MySQL both implement standard SQL syntax, including common table expressions and window functions as well as JSON and geospatial functions. However, MariaDB adds the INTERSECT and EXCEPT set operators, linear regression functions and more.

Which database is better MariaDB or MySQL?

When it comes to performing queries or replication, MariaDB is faster than MySQL. So if you need a high-performance relational database solution, MariaDB is a good choice. In addition, MariaDB also easily supports a high concurrent number of connections without much performance degradation.

What type of database is MariaDB?

MariaDB is an open source relational database management system (DBMS) that is a compatible drop-in replacement for the widely used MySQL database technology.


1 Answers

MariaDB has the MEMORY storage engine:

It is best-used for read-only caches of data from other tables, or for temporary work areas.

That sounds exactly right for quick setup and teardown of a database during automated testing.

like image 183
bignose Avatar answered Sep 18 '22 17:09

bignose