Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in...

23
Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

Transcript of Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in...

Page 1: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

1

Persistent Memory Use Cases in Modern Software ArchitecturesOlasoji Denloye, SW Engineer, Intel Corporation

Page 2: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

22

Persistent MemoryOverview

2

Page 3: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

3

Properties of Persistent Memory

• Byte-addressable like DRAM

• Direct user-level access

• Lowers DRAM footprint

• Works with both File and Memory PM APIs

• Multiple Modes

• Memory Mode - Persistent Memory as Main Memory

• App Direct Mode - OS aware of Persistent Memory

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 4: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

4

The SNIA NVM Programming Model

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 5: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

5

Common Use Cases

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

• Caches

• Data structures for fast lookup

• Stores

• Device for persisting data

• Buffers

• Temporary data storage

• Using Persistent Memory:

• As volatile memory

• As persistent memory

Page 6: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

66

Caches

6

Page 7: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

7

Caches

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

• Caches are fast and lightweight data structures

• Typically live on DRAM for speed

• Constrained by DRAM size

• Persistent Memory provides larger capacities than DRAM

• Persistent caches give faster restart times

Page 8: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

8

Hbase BucketCache- Manages buckets of memory

containing fixed size blocks

- Moved the cache from DRAM to Persistent Memory

- Uses mapped file based allocator

https://issues.apache.org/jira/browse/HBASE-21874

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

source: https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.4/hbase-data-access/content/overview-hbase-io.html

Page 9: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

9

MemcacheD - DRAM

- In memory Key-Value store

- Used as a cache

- Designed to be simple and fast

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

HashTable

Slab

Slab

DRAM

Eviction

Page 10: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

10

MemcacheD – Restartable Cache

• Custom mapped file allocator

• Hybrid data structure

• Hashtable on DRAM

• Slabs on Persistent Memory

• Restartable

• Flush CPU caches on controlled shutdown

• Rebuild Hashtable on restart

https://github.com/memcached/memcached/wiki/WarmRestart

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Persistent Memory

Hashtable

Slab

Slab

DRAM

Page 11: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

11

Spark SQL

Spark OAP (Optimized Analytics Platform)

• OAP is a SparkSQL accelerator

• IO cache

• Uses Persistent Memory Development Kit (PMDK) : libvmemcache

• Open source

• Volatile LRU cache

• Keys in DRAM, values on PMEM

https://github.com/Intel-bigdata/OAP© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 12: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

1212

Storage

12

Page 13: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

13

Storage

• Persists data

• Large capacity

• Typically on solid state or spinning drives

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

• Persistent Memory is faster than NVMe/SAS/SATA drives

• Finer grained access : byte vs block

• No need for serialization/deserialization

• Update in place

• Simpler code

Page 14: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

14

Cassandra Write Path

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 15: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

15

Write Path – Persistent Memory Storage

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 16: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

16

Cassandra Read Path

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 17: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

17

Read Path – Persistent Memory Storage

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 18: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

18

Cassandra Persistent Memory Storage Engine• Uses open source components

• Low level Persistence Library

• PMDK

• Adaptive Radix Tree

• Pluggable engine

• 6 - 8X speedups on reads and writes

• https://github.com/intel/cassandra-pmem

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 19: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

19

Considerations on Persistent Use of Persistent Memory• Data Integrity

• On a controlled shutdown : flush caches

• On an uncontrolled shutdown (e.g. power failure, crash): transactions

• Concurrency

• CAS + flush is not atomic

• Fragmentation

• Existing problem worsened by longer lived memory pools

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 20: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

20

Summary

• Persistent memory is available and valuable

• Upstreamed in open source projects

• Multiple ways to extract value

• No code change OR data structure redesign

• Libraries available to help

• PMDK suite

• Low Level Persistence Library - Java

• Memory Mapped files

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

Page 21: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

21

Links

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.

• Hbase Bucket Cache: https://issues.apache.org/jira/browse/HBASE-21874

• MemcacheD: https://github.com/memcached/memcached/wiki/WarmRestart

• Spark OAP: https://github.com/Intel-bigdata/OAP

• Cassandra PMEM: https://github.com/intel/cassandra-pmem

• PMDK: https://pmem.io/pmdk/

• Libvmemcache: https://github.com/pmem/vmemcache

• Low Level Persistence Library: https://github.com/pmem/llpl

• Adaptive Radix Tree: https://db.in.tum.de/~leis/papers/ART.pdf

Page 22: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

2222

Thank youPlease visit www.snia.org/pmsummit for presentations

22

Page 23: Persistent Memory Use Cases in Modern Software Architectures · 1 Persistent Memory Use Cases in Modern Software Architectures Olasoji Denloye, SW Engineer, Intel Corporation

23

Cassandra Pluggable Storage Engine API

© 2020 SNIA Persistent Memory Summit. All Rights Reserved.