Configuring In-Memory Engine in MySQL

2023. 4. 3. 12:58it

반응형


0. Specs

- In MySQL 5.7 and above, the in-memory engine is provided by default.

1. TASKS
1-1. Open the configuration file (my.cnf) and activate the in-memory engine.

728x90
[mysqld]
default_storage_engine=InnoDB
innodb_buffer_pool_size=256M

 
1-2. Restart MySQL.
 
1-3. Create in-memory tables.

반응형
CREATE TABLE example (
    id INT NOT NULL AUTO_INCREMENT,
    name VARCHAR(50),
    PRIMARY KEY (id)
) ENGINE=MEMORY;



This engine stores data in memory, providing faster speed and lower latency. 
While the in-emory engine is very fast and has excellent performance,
its performance may be affected by the available memory.
Additionally, since the data is stored in memory instead of in the database,
recovering data in the event of a system failure can be difficult.
 
Therefore, it is important to use the in-memory engine appropriately, taking these drawbacks into consideration.

반응형