Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering RethinkDB

You're reading from   Mastering RethinkDB Master the skills of building real-time apps dramatically easier with open source, scalable database - RethinkDB

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher Packt
ISBN-13 9781786461070
Length 330 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Shahid Shaikh Shahid Shaikh
Author Profile Icon Shahid Shaikh
Shahid Shaikh
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. The RethinkDB Architecture and Data Model 2. RethinkDB Query Language FREE CHAPTER 3. Data Exploration Using RethinkDB 4. Performance Tuning in RethinkDB 5. Administration and Troubleshooting Tasks in RethinkDB 6. RethinkDB Deployment 7. Extending RethinkDB 8. Full Stack Development with RethinkDB 9. Polyglot Persistence Using RethinkDB 10. Using RethinkDB and Horizon

Filesystem and data storage

RethinkDB supports major used filesystems such as NTFS, EXT and so on. RethinkDB also supports direct I/O filesystems for efficiency and performance, but it is not enabled by default.

About direct I/O

File is stored on disk and when it's been requested by any program, the operating system first puts it into the main memory for faster reads. The operating system can read directly from disk too, but that would slow down the response time because of heavy-cost I/O operation. Hence, the operating system first puts it into the main memory for operation. This is called buffer cache.

Databases generally manage data caching at the application and they do not need the operating system to cache it for them. In such cases, the process of buffering at two places (main memory and application cache) becomes an overhead since data is first moved to the main memory and then the application cache.

This double buffering of data results in more CPU consumption and load on the memory too.

Direct I/O is a filesystem for those applications that want to avoid the buffering at the main memory and directly read files from disk. When direct I/O is used, data is transferred directly to the application buffer instead of the memory buffer, as shown in the following diagram:

About direct I/O

Direct I/O can be used in two ways:

  • Mounting the filesystem using direct I/O (options vary from OS to OS)
  • Opening the file using the O_DIRECT option specified in the open() system call

Direct I/O provides great efficiency and performance by reducing CPU consumption and the overhead of managing two buffers.

Data storage

RethinkDB uses a custom-built storage engine inspired by the Binary tree file system by Oracle (BTRFS). There is not enough information available on the RethinkDB custom filesystem right now, but we have found the following promises by it:

  • Fully concurrent garbage compactor
  • Low CPU overhead
  • Efficient multi-core operation
  • SSD optimization
  • Power failure recovery
  • Data consistency in case of failure
  • MVCC supports

Due to these features, RethinkDB can handle large amounts of data in very little memory storage.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image