Managing large application state easily, resiliently, and with high performance is one of the hardest problems in the cloud today. The FASTER project offers two artifacts to help tackle this problem.
-
FASTER Log is a high-performance concurrent persistent recoverable log, iterator, and random reader library in C#. It supports very frequent commit operations at low latency, and can quickly saturate disk bandwidth. It supports both sync and async interfaces, handles disk errors, and supports checksums. Learn more about using the FASTER Log in C# here.
-
FASTER KV is a concurrent key-value store + cache (available in C# and C++) that is designed for point lookups and heavy updates. FASTER supports data larger than memory, by leveraging fast external storage (local or cloud). It also supports consistent recovery using a new checkpointing technique that lets applications trade-off performance for commit latency. Learn more about the FASTER KV in C# here. For the FASTER C++ port, check here.
Key Features
- Latch-free cache-optimized index, in FASTER KV.
- A fast persistent recoverable append-only log based on fine-grained epoch protection for concurrency, in FASTER Log.
- Unique “hybrid record log” design in FASTER KV, that combines the above log with in-place updates, to shape the memory working set and retain performance.
- Architecture as a component that can be embedded in multi-threaded cloud apps.
- Asynchronous non-blocking recovery model based on group commit.
- A rich extensible storage device abstraction called
IDevice
, with implementations for local storage, cloud storage, tiered storage, and sharded storage. - A new high performance remote interface, making the store accessible via TCP from remote clients.
For standard benchmarks where the working set fits in main memory, we found FASTER KV to achieve significantly higher throughput than current systems, and match or exceed the performance of pure in-memory data structures while offering more functionality. See our research papers for more details. We also have a detailed analysis of C# FASTER KV performance in a wiki page here. The performance of the C# and C++ versions of FASTER is very similar. FASTER Log is also extremely fast, capable of saturating modern NVMe SSDs using less than a core of CPU, and scaling well in a multi-threaded setting.
News and Updates
-
Version 2.5 of FASTER has been released with various improvements. A notable new feature is the lockable context which allows users to perform multi-key operations with locking (i.e., transactions).
-
Version 2 of FASTER has been released with many API and performance improvements across the board. Learn more about the features in v2 at https://github.com/microsoft/FASTER/pull/563
-
A high-performance remote (TCP) interface to FasterKV is now available! It provides linear server scalability with increasing client sessions, with similar server throughput as embedded FasterKV. We provide a default C# client as well as an ability to extend to other protocols. Learn more here.
-
We support variable-length keys and values in FasterKV C# via
Memory<byte>
and more generallyMemory<T> where T : unmanaged
as key/value/input types. We also added a new type calledSpanByte
to represent variable-length keys and values. See the sample here for details on these capabilities. This is in addition to the existing object-log support for class types. -
We support C# async in FASTER KV (and FASTER Log). See the guides for FasterKV and FasterLog for more information. Also, check out the samples here.
Getting Started
- Quick-Start Guide and Docs: here
- Source Code: https://github.com/microsoft/FASTER
- C# Samples: https://github.com/microsoft/FASTER/tree/main/cs/samples
- C# NuGet binary feed:
- Checkpointing and Recovery: link
- Research papers: link
- Project roadmap: here
Thanks to Minimal Mistakes for their amazing website theme.
Embedded key-value store sample
public static void Test()
{
using var settings = new FasterKVSettings<long, long>("c:/temp"); // backing storage device
using var store = new FasterKV<long, long>(settings);
// Create a session per sequence of interactions with FASTER
// We use default callback functions with a custom merger: RMW merges input by adding it to value
using var session = store.NewSession(new SimpleFunctions<long, long>((a, b) => a + b));
long key = 1, value = 1, input = 10, output = 0;
// Upsert and Read
session.Upsert(ref key, ref value);
session.Read(ref key, ref output);
Debug.Assert(output == value);
// Read-Modify-Write (add input to value)
session.RMW(ref key, ref input);
session.RMW(ref key, ref input, ref output);
Debug.Assert(output == value + 20);
}