concept memory in category streaming

appears as: memory, memory
Streaming Data: Understanding the real-time pipeline

This is an excerpt from Manning's book Streaming Data: Understanding the real-time pipeline.

  • In-memory data store tier— The tweets that are mere seconds old are most likely held in an in-memory data store.
  • Then we have the last two options: analyzing and storing the data for real-time access and analyzing and storing the data for batch/offline access. Why in a book on streaming systems are we spending time discussing storing data for batch/offline access? Great question. We won’t be digging into how to choose one of these data stores; many books and online resources are dedicated to that topic. Instead, we will be looking at these storage options from the viewpoint of a stream and developing our understanding of the delicate balance between the two systems. After that we will turn our focus for the rest of the chapter toward the technologies and ideas we need to keep in mind for our in-memory store. By the end you will know how to handle both storage scenarios and be poised to set up a streaming system with an in-memory store.

    With this strategy, the caching system eventually writes the new data to the persistent store. Unlike write-through, where the data is immediately written, with write-back the write to the cache is acknowledged, and then in the background the updated or new data is written to the persistent store. This has the advantage of not incurring the I/O overhead of the write-through, although for the period of time when the data is only held in memory there is a risk of data loss. Write-back is illustrated in figure 6.8.

    Figure 6.8. Write-back caching strategy

    With all these strategies you’re either in a situation where the data is only in-memory or you pay the cost of having to load data from a persistent store. The fact that there is often no option to store the data other than in memory poses a risk as well because if you lose a cache node, you lose your data.

    6.2.3. In-memory database and in-memory data grid

    In-memory databases (IMDBs) are sometimes called in-memory database management systems and in-memory data grids (IMDGs). Unlike the caching systems, IMDBs and IMDGs are designed to use disk for the non-volatile persistence of data. Although the products in this category use a storage medium other than DRAM, they are designed to use memory first and disk second. In fact, disk storage is often only used for logging and periodic snapshots so the data is available in the face of failure. This subtle design decision is what separates the true IMDBs and IMDGs from the traditional databases that now offer an in-memory option. Traditional databases (Microsoft SQL Server, Oracle, and so on) as well as modern NoSQL ones (such as Apache Cassandra) were all designed with a disk-first, memory-second mindset.