# Are You Sure You Want to Use MMAP in Your Database Management System?

DevFeed: [Are You Sure You Want to Use MMAP in Your Database Management System?](<https://devfeed.tech/articles/are-you-sure-you-want-to-use-mmap-in-your-database-management-system-24789.md>)

Original publisher: [Read original article](<https://dev.cheremin.info/2022/01/are-you-sure-you-want-to-use-mmap-in.html>)

Author: Ruslan Cheremin (noreply@blogger.com)

Published: 2022-01-30T16:51:00Z

Content type: article

Language: ru

Sources: [\>рабочие заметки](<https://devfeed.tech/sources/source-2.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [IO](<https://devfeed.tech/topics/io.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [io](<https://devfeed.tech/tags/io.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [linux](<https://devfeed.tech/tags/linux.md>), [performance](<https://devfeed.tech/tags/performance.md>), [tag-cb5ff012b3f0](<https://devfeed.tech/tags/tag-cb5ff012b3f0.md>), [tag-e50b791533a6](<https://devfeed.tech/tags/tag-e50b791533a6.md>)

## AI overview

This Russian-language article examines whether memory-mapped files are suitable for database management systems. It argues that their apparent convenience can conceal operational issues requiring effort comparable to implementing a page cache, and that their expected performance advantage is not guaranteed. For modern SSDs and NVM, the cited article reports that memory-mapped reads can deliver 2-20 times lower throughput than direct reads that bypass the file cache, due to virtual-memory overhead such as page eviction and page-table updates.

## Source excerpt

Кажется, что отображение файлов в память (mmap) удобно использовать для реализации баз данных, потому что можно не реализовывать пул страниц, а бесплатно использовать всю машинерию виртуальной памяти, уже существующую в ОС - работать с данными как будто они лежат в памяти, и ОС позаботится почти обо всех деталях. В статье Are You Sure You Want to Use MMAP in Your Database Management System?1