> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-vortex-format.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Memory データベースエンジンは、データベースのメタデータとテーブルを現在のサーバーセッションの間だけ保持します。

# Memory

`Memory` データベースエンジンは、メタデータとテーブル定義をメモリ上にのみ保持します。一時的なデータベースでの利用を想定しており、サーバーが停止または再起動すると、データベースとそのテーブルは失われます。

## データベースの作成

```sql theme={null}
CREATE DATABASE temporary_data
ENGINE = Memory;
```

## 使用方法

[`Atomic`](/ja/reference/engines/database-engines/atomic) データベースと同じようにテーブルを作成して使用します:

```sql theme={null}
CREATE TABLE temporary_data.events
(
    id UInt64,
    name String
)
ENGINE = Memory;

INSERT INTO temporary_data.events VALUES (1, 'started');
```

再起動後も保持する必要があるデータや定義には、このエンジンを使用しないでください。永続的なデータベースメタデータには、デフォルトのオープンソースデータベースエンジンである `Atomic` を使用してください。

## 関連項目

* [Atomic データベースエンジン](/ja/reference/engines/database-engines/atomic)
* [`Memory` テーブルエンジン](/ja/reference/engines/table-engines/special/memory)
