Today we’re excited to announce the 1.0 release of the Momento Cache client for .NET.
At Momento, simplicity is one of our north stars. We want the Momento experience to be simple and delightful for our users, on both the server side and the client side. On the server side, this means you just create your cache and go, and leave all of the scaling and operations concerns to us. On the client side, this means having an SDK that makes it simple and intuitive to write bug-free code that interacts with your cache, and not having to spend a ton of your time thinking about tuning, thread-safety, or other esoteric concerns.
To that end we’ve been hard at work over the last few weeks polishing up our .NET client library, making sure the APIs are clean and easy to work with, and making sure it’s easy to consume from your .NET environment. Now we’re ready to share the finished product with you!
Sidenote: If you want to dive into the nitty gritty of exactly how we tuned the .NET SDK, check out this deep dive.
.NET client library highlights
The Momento SimpleCacheClient is thread-safe and handles all of the network connection management for you, so you can just create a single instance and hit the ground running. You don’t need to worry about thread-safety or connection pools.
All of the methods on the SimpleCacheClient are asynchronous, so you can consume it from your existing asynchronous application code without any concerns about blocking threads and bottlenecking your application. If your application is synchronous, no worries; our return values are all Tasks, so you can use them from your synchronous code too.
Discoverable response types for bug-free code
There are multiple types of responses you can get from an API call. For example, when you make a Get request to get a value from your cache, the response might be a Hit, a Miss, or an Error. Depending on which of those you get back, there will be a very different set of properties that you need to access on the response. (For example, a Hit will have an associated Value that contains the data from your cache, but a Miss will not.) The Momento .NET client uses pattern matching to give you a strongly-typed response object for each of those cases, so that you can easily discover all of the possible values in your IDE and get compile-time type checking to prevent bugs. It’s always more pleasant to find a bug at compile time than at run time!
Easy logging configuration
The Momento .NET client integrates with the Microsoft.Extensions.Logging package, so logs from your Momento client will be routed to the same destinations as the rest of your logs. Just pass us your ILoggerFactory!
Tuning a network client can be a lot of work, and the best settings can differ pretty dramatically between environments. For example, the best settings to allow you to explore and debug from your laptop probably aren’t the same settings that you want in your low-latency production environment in the cloud. To help keep things simple, the Momento .NET client comes with several pre-built configurations designed for different types of environments like these. The configuration is fully customizable if you have a unique need that we haven’t accounted for, but we did our best to make sure we would have the 90% case covered so that you don’t need to spend your engineering hours on tuning.
Take the .NET client for a spin today
You can get started with the 1.0 version of the Momento Cache .NET client right now. If you haven’t created a free Momento cache yet, visit our Momento getting started docs. Then check out the docs for getting started with the .NET client on GitHub!
We hope you love it! And if you don’t, we’d love to hear about it so we can improve it further! File a GitHub issue or ping us at <a href="mailto:email@example.com.">firstname.lastname@example.org</a>
Stay tuned for additional announcements about exciting new features. In the 1.0 version we support basic cache management operations, as well as get and set operations for your cache keys. In an upcoming release we will be adding many more operations, including support for data structures such as lists, sets, and dictionaries!