55
© The Author(s) 2020
S. Scargall, Programming Persistent Memory, https://doi.org/10.1007/978-1-4842-4932-1_4
CHAPTER 4
Fundamental Concepts
of Persistent Memory
Programming
In Chapter 3, you saw how operating systems expose persistent memory to applications
as memory-mapped files. This chapter builds on this fundamental model and examines
the programming challenges that arise. Understanding these challenges is an essential
part of persistent memory programming, especially when designing a strategy for
recovery after application interruption due to issues like crashes and power failures.
However, do not let these challenges deter you from persistent memory programming!
Chapter 5 describes how to leverage existing solutions to save you programming time
and reduce complexity.
What’s Different?
Application developers typically think in terms of memory-resident data structures and
storage-resident data structures. For data center applications, developers are careful to
maintain consistent data structures on storage, even in the face of a system crash. This
problem is commonly solved using logging techniques such as write-ahead logging,
where changes are first written to a log and then flushed to persistent storage. If the data
modification process is interrupted, the application has enough information in the log
to finish the operation on restart. Techniques like this have been around for many years;
however, correct implementations are challenging to develop and time-consuming to
maintain. Developers often rely on a combination of databases, libraries, and modern
file systems to provide consistency. Even so, it is ultimately the application developer’s
Précédent

- 84/457

Suivant