Akavache 11.4.1
Prefix Reserveddotnet add package Akavache --version 11.4.1
NuGet\Install-Package Akavache -Version 11.4.1
<PackageReference Include="Akavache" Version="11.4.1" />
<PackageVersion Include="Akavache" Version="11.4.1" />
<PackageReference Include="Akavache" />
paket add Akavache --version 11.4.1
#r "nuget: Akavache, 11.4.1"
#:package Akavache@11.4.1
#addin nuget:?package=Akavache&version=11.4.1
#tool nuget:?package=Akavache&version=11.4.1
<br>
<a href="https://www.nuget.org/packages/akavache.sqlite3">
<img src="https://img.shields.io/nuget/dt/akavache.sqlite3.svg">
</a>
<a href="#backers">
<img src="https://opencollective.com/reactiveui/backers/badge.svg">
</a>
<a href="#sponsors">
<img src="https://opencollective.com/reactiveui/sponsors/badge.svg">
</a>
<a href="https://reactiveui.net/slack">
<img src="https://img.shields.io/badge/chat-slack-blue.svg">
</a>
<img alt="Akavache" src="https://raw.githubusercontent.com/reactiveui/styleguide/master/logo_akavache/main.png" width="150" />
Akavache V11.1: An Asynchronous Key-Value Store for Native Applications
Akavache is an asynchronous, persistent (i.e., writes to disk) key-value store created for writing desktop and mobile applications in C#, based on SQLite3. Akavache is great for both storing important data (i.e., user settings) as well as cached local data that expires.
What's New in V11.1
Akavache V11.1 introduces a new Builder Pattern for initialization, improved serialization support, and enhanced cross-serializer compatibility:
- ๐๏ธ Builder Pattern: New fluent API for configuring cache instances
- ๐ Multiple Serializer Support: Choose between System.Text.Json, Newtonsoft.Json, each with a BSON variant
- ๐ Cross-Serializer Compatibility: Read data written by different serializers
- ๐งฉ Modular Design: Install only the packages you need
- ๐ฑ Enhanced .NET MAUI Support: First-class support for .NET 9 cross-platform development
- ๐ Improved Security: Better encrypted cache implementation
Development History
Akavache V11.1 represents a significant evolution in the library's architecture, developed through extensive testing and community feedback in our incubator project. The new features and improvements in V11.1 were first prototyped and battle-tested in the ReactiveMarbles.CacheDatabase repository, which served as an experimental ground for exploring new caching concepts and architectural patterns.
Key Development Milestones:
- ๐งช Incubation Phase: The builder pattern, modular serialization system, and enhanced API were first developed and tested in ReactiveMarbles.CacheDatabase
- ๐ฌ Community Testing: Early adopters and contributors provided valuable feedback on the new architecture through real-world usage scenarios
- ๐ Production Validation: The incubator project allowed us to validate performance improvements, API ergonomics, and cross-platform compatibility before integrating into Akavache
- ๐ Iterative Refinement: Multiple iterations based on community feedback helped shape the final V11.1 API design and feature set
This careful incubation process ensured that V11.1 delivers not just new features, but a more robust, flexible, and maintainable caching solution that builds upon years of community experience and testing.
Quick Start
1. Install Packages
<PackageReference Include="Akavache.Sqlite3" Version="11.1.*" />
<PackageReference Include="Akavache.SystemTextJson" Version="11.1.*" />
2. Initialize Akavache
Note:
WithAkavache
,WithAkavacheCacheDatabase
andInitialize
always requires anISerializer
defined as a generic type, such asWithAkavache<SystemJsonSerializer>
. This ensures the cache instance is properly configured for serialization.
Static Initialization (Recommended for most apps)
using Akavache.Core;
using Akavache.SystemTextJson;
using Akavache.Sqlite3;
using Splat.Builder;
// Initialize with the builder pattern
AppBuilder.CreateSplatBuilder()
.WithAkavacheCacheDatabase<SystemJsonSerializer>(builder =>
builder.WithApplicationName("MyApp")
.WithSqliteProvider() // REQUIRED: Explicitly initialize SQLite provider
.WithSqliteDefaults());
Important: Always call
WithSqliteProvider()
explicitly beforeWithSqliteDefaults()
. WhileWithSqliteDefaults()
will automatically callWithSqliteProvider()
if not already initialized (for backward compatibility), this automatic behavior is deprecated and may be removed in future versions. Explicit provider initialization is the recommended pattern for forward compatibility with other DI containers.
Dependency Injection Registration (for DI containers)
using Akavache.Core;
using Akavache.SystemTextJson;
using Akavache.Sqlite3;
using Splat.Builder;
// Example: Register Akavache with Splat DI
AppBuilder.CreateSplatBuilder()
.WithAkavache<SystemJsonSerializer>(
"MyApp",
builder => builder.WithSqliteProvider() // REQUIRED: Explicit provider initialization
.WithSqliteDefaults(),
(splat, instance) => splat.RegisterLazySingleton(() => instance));
// For in-memory cache (testing or lightweight scenarios):
AppBuilder.CreateSplatBuilder()
.WithAkavache<SystemJsonSerializer>(
"Akavache",
builder => builder.WithInMemoryDefaults(), // No provider needed for in-memory
(splat, instance) => splat.RegisterLazySingleton(() => instance));
3. Use the Cache
Basic Operations
// Store an object
var user = new User { Name = "John", Email = "john@example.com" };
await CacheDatabase.UserAccount.InsertObject("current_user", user);
// Retrieve an object
var cachedUser = await CacheDatabase.UserAccount.GetObject<User>("current_user");
// Store with expiration
await CacheDatabase.LocalMachine.InsertObject("temp_data", someData, DateTimeOffset.Now.AddHours(1));
// Get or fetch pattern
var data = await CacheDatabase.LocalMachine.GetOrFetchObject("api_data",
async () => await httpClient.GetFromJsonAsync<ApiResponse>("https://api.example.com/data"));
Cache Types
Akavache provides four types of caches:
- UserAccount: User settings and preferences that should persist and potentially sync
- LocalMachine: Cached data that can be safely deleted by the system
- Secure: Encrypted storage for sensitive data like credentials and API keys
- InMemory: Temporary storage that doesn't persist between app sessions
// User preferences (persistent)
await CacheDatabase.UserAccount.InsertObject("user_settings", settings);
// API cache (temporary)
await CacheDatabase.LocalMachine.InsertObject("api_cache", apiData, DateTimeOffset.Now.AddHours(6));
// Sensitive data (encrypted)
await CacheDatabase.Secure.SaveLogin("john.doe", "secretPassword", "myapp.com");
// Session data (in-memory only)
await CacheDatabase.InMemory.InsertObject("current_session", sessionData);
Installation
Akavache V11.1 uses a modular package structure. Choose the packages that match your needs:
Core Package (In Memory only)
<PackageReference Include="Akavache" Version="11.1.*" />
Storage Backends (Choose One - Recommended)
<PackageReference Include="Akavache.Sqlite3" Version="11.1.*" />
<PackageReference Include="Akavache.EncryptedSqlite3" Version="11.1.*" />
Serializers (Choose One - Required)
<PackageReference Include="Akavache.SystemTextJson" Version="11.1.*" />
<PackageReference Include="Akavache.NewtonsoftJson" Version="11.1.*" />
Optional Extensions
<PackageReference Include="Akavache.Drawing" Version="11.1.*" />
<PackageReference Include="Akavache.Settings" Version="11.1.*" />
Framework Support
Akavache V11.1 supports:
- โ .NET Framework 4.6.2/4.7.2 - Windows desktop applications
- โ .NET Standard 2.0 - Cross-platform libraries
- โ .NET 8.0 - Modern .NET applications
- โ .NET 9.0 - Latest .NET applications
- โ
Mobile Targets -
net9.0-android
,net9.0-ios
,net9.0-maccatalyst
- โ
Desktop Targets -
net9.0-windows
(WinUI),net9.0
(cross-platform)
Serializer Compatibility
Serializer | .NET Framework 4.6.2+ | .NET Standard 2.0 | .NET 8.0+ | Mobile | Performance |
---|---|---|---|---|---|
System.Text.Json | โ Via NuGet | โ | โ | โ | Fastest |
Newtonsoft.Json | โ Built-in | โ | โ | โ | Compatible |
Recommendation: Use System.Text.Json for new projects for best performance. Use Newtonsoft.Json when migrating from older Akavache versions or when you need maximum compatibility.
Akavache.Settings: Configuration Made Easy
Akavache.Settings provides a specialized settings database for application configuration that survives app updates and reinstalls.
Quick Settings Example
using Akavache.Settings;
// 1. Create a settings class
public class AppSettings : SettingsBase
{
public AppSettings() : base(nameof(AppSettings)) { }
public bool EnableNotifications
{
get => GetOrCreate(true); // Default: true
set => SetOrCreate(value);
}
public string UserName
{
get => GetOrCreate("DefaultUser");
set => SetOrCreate(value);
}
public int MaxRetries
{
get => GetOrCreate(3);
set => SetOrCreate(value);
}
}
// 2. Initialize with your app
var appSettings = default(AppSettings);
AppBuilder.CreateSplatBuilder()
.WithAkavache<SystemJsonSerializer>(builder =>
builder.WithApplicationName("MyApp")
.WithSqliteProvider()
.WithSettingsStore<AppSettings>(settings => appSettings = settings));
// 3. Use the settings
appSettings.EnableNotifications = false;
appSettings.UserName = "John Doe";
appSettings.MaxRetries = 5;
Console.WriteLine($"User: {appSettings.UserName}");
Console.WriteLine($"Notifications: {appSettings.EnableNotifications}");
Settings are automatically persisted and will survive app updates, making them perfect for user preferences and application configuration.
Documentation
๐ Complete documentation is available in the /docs folder:
- Installation Guide - Detailed installation and package selection
- Configuration - Builder pattern, providers, and advanced setup
- Serializers - System.Text.Json vs Newtonsoft.Json comparison
- Cache Types - UserAccount, LocalMachine, Secure, and InMemory caches
- Basic Operations - CRUD operations and error handling
- Migration Guide - Upgrading from V10.x to V11.1
- Settings Management - Complete Akavache.Settings guide
- Platform Notes - Platform-specific guidance
- Performance - Benchmarks and optimization tips
- Best Practices - Recommended patterns and anti-patterns
- Troubleshooting - Common issues and solutions
Support and Contributing
- ๐ Documentation: https://github.com/reactiveui/Akavache
- ๐ Issues: GitHub Issues
- ๐ฌ Chat: ReactiveUI Slack
- ๐ฆ NuGet: Akavache Packages
Thanks
This project is tested with BrowserStack.
We want to thank the following contributors and libraries that help make Akavache possible:
Core Libraries
- SQLite: sqlite-net-pcl and SQLitePCLRaw - Essential SQLite support for .NET
- System.Reactive: Reactive Extensions for .NET - The foundation of Akavache's asynchronous API
- Splat: Splat - Cross-platform utilities and service location
- System.Text.Json: Microsoft's high-performance JSON serializer
- Newtonsoft.Json: James Newton-King's Json.NET - The most popular .NET JSON library
Microsoft
<a href="https://dotnetfoundation.org"> <img src="https://theme.dotnetfoundation.org/img/logo.svg" width="100" /> </a>
We thank Microsoft for their ongoing support of the .NET ecosystem and the development tools that make Akavache possible.
License
Akavache is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-android35.0 is compatible. net9.0-browser was computed. net9.0-ios was computed. net9.0-ios18.0 is compatible. net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 is compatible. net9.0-macos was computed. net9.0-macos15.0 is compatible. net9.0-tvos was computed. net9.0-windows was computed. net9.0-windows10.0.17763 is compatible. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Net.Http (>= 4.3.4)
- System.Reactive (>= 6.0.2)
-
.NETFramework 4.7.2
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Net.Http (>= 4.3.4)
- System.Reactive (>= 6.0.2)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Reactive (>= 6.0.2)
-
net8.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Reactive (>= 6.0.2)
-
net9.0-android35.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- System.Reactive (>= 6.0.2)
-
net9.0-ios18.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- System.Reactive (>= 6.0.2)
-
net9.0-maccatalyst18.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Reactive (>= 6.0.2)
-
net9.0-macos15.0
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Reactive (>= 6.0.2)
-
net9.0-windows10.0.17763
- Microsoft.Bcl.AsyncInterfaces (>= 9.0.8)
- Splat.Builder (>= 16.2.1)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.11)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.11)
- System.Reactive (>= 6.0.2)
NuGet packages (61)
Showing the top 5 NuGet packages that depend on Akavache:
Package | Downloads |
---|---|
Akavache.Sqlite3
Package Description |
|
SheshaMobile.Core
Common application functionality and features to be shared across the framework |
|
SheshaMobile.Modules
The modules module contains common functionality shared across multiple modules |
|
SheshaMobile.Modules.UserProfile
A module for building apps with user functionality |
|
SheshaMobile.Modules.Facilities
The facilities module contains common functionality for browsing and viewing facilities |
GitHub repositories (15)
Showing the top 15 popular GitHub repositories that depend on Akavache:
Repository | Stars |
---|---|
CodeHubApp/CodeHub
CodeHub is an iOS application written using Xamarin
|
|
MoocDownloader/MoocDownloader
An MOOC downloader implemented by .NET. ไธๆ็ฑ .NET ๅฎ็ฐ็ MOOC ไธ่ฝฝๅจ.
|
|
reactiveui/Camelotia
Cross-platform sample .NET GUI for cloud file management.
|
|
reactiveui/ReactiveUI.Samples
This repository contains ReactiveUI samples.
|
|
nor0x/Dots
the 🙂 friendly .NET SDK manager
|
|
mmbot/mmbot
A C# port of Hubot
|
|
flagbug/Espera
Espera is a media player that plays your music, YouTube videos, SoundCloud songs and has a special "party mode".
|
|
Clancey/gMusic
This is a multi platform music player.
|
|
thedillonb/CodeBucket
CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad device!
|
|
Ombrelin/plex-rich-presence
A desktop app to enable discord rich presence for your Plex Media Server Activity
|
|
Respawnsive/Apizr
Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority, etc...)
|
|
kentcb/WorkoutWotch
Repository for my video series on building an iOS app in .NET.
|
|
Titlehhhh/Minecraft-Holy-Client
A high-performance platform for running Minecraft stress-test bots written in C#.
|
|
thedillonb/RepoStumble
A mobile application for viewing GitHub repositories in a fashion similar to StumbleUpon
|
|
sthewissen/MVP
Unofficial app to help MVPs manage their community activities
|
Version | Downloads | Last Updated |
---|---|---|
11.4.1 | 109 | 9/9/2025 |
11.3.3 | 187 | 9/6/2025 |
11.1.1 | 347 | 9/2/2025 |
11.0.1 | 629 | 8/24/2025 |
10.2.41 | 10,446 | 3/16/2025 |
10.1.6 | 117,826 | 9/16/2024 |
10.0.1 | 84,866 | 5/1/2024 |
9.1.20 | 281,586 | 6/29/2023 |
9.1.7 | 68,441 | 2/1/2023 |
9.0.1 | 237,168 | 6/25/2022 |
8.1.1 | 212,702 | 12/12/2021 |
7.3.47 | 14,377 | 11/26/2021 |
7.3.1 | 138,762 | 6/6/2021 |
7.2.1 | 250,938 | 1/22/2021 |
7.1.1 | 183,260 | 10/23/2020 |
6.10.20 | 4,266,393 | 6/12/2020 |
6.10.17 | 50,536 | 5/7/2020 |
6.10.11 | 14,446 | 4/23/2020 |
6.10.6 | 14,560 | 4/1/2020 |
6.10.4 | 48,882 | 2/5/2020 |
6.10.3 | 9,602 | 1/29/2020 |
6.10.2 | 6,467 | 1/27/2020 |
6.10.1 | 1,126 | 1/27/2020 |
6.9.10 | 43,756 | 11/4/2019 |
6.9.1 | 40,469 | 10/5/2019 |
6.8.1 | 17,289 | 9/6/2019 |
6.7.1 | 15,056 | 8/6/2019 |
6.6.1 | 1,342 | 8/6/2019 |
6.5.20 | 18,469 | 7/28/2019 |
6.5.9 | 32,530 | 6/7/2019 |
6.5.1 | 91,658 | 3/27/2019 |
6.4.1 | 7,387,139 | 3/3/2019 |
6.3.6 | 8,472 | 2/19/2019 |
6.3.2 | 19,033 | 2/1/2019 |
6.3.1 | 3,164 | 1/25/2019 |
6.2.3 | 20,388 | 12/27/2018 |
6.2.1 | 1,389 | 12/27/2018 |
6.1.3 | 1,900 | 12/24/2018 |
6.1.2 | 2,308 | 12/24/2018 |
6.1.1 | 2,008 | 12/23/2018 |
6.0.31 | 40,315 | 11/11/2018 |
6.0.30 | 41,804 | 10/17/2018 |
6.0.27 | 14,438 | 10/5/2018 |
6.0.20 | 56,321 | 9/5/2018 |
6.0.19-beta | 1,235 | 9/3/2018 |
6.0.17-beta | 2,170 | 8/24/2018 |
6.0.0-alpha0038 | 78,559 | 9/3/2017 |
5.0.0 | 502,961 | 11/4/2016 |
4.1.2 | 84,052 | 10/27/2015 |
4.1.1 | 20,821 | 3/26/2015 |
4.1.0 | 5,706 | 1/3/2015 |
4.0.4 | 3,660 | 11/6/2014 |
4.0.3.2 | 6,947 | 8/28/2014 |
4.0.3.1 | 1,923 | 8/28/2014 |
4.0.3 | 1,862 | 8/28/2014 |
4.0.2 | 1,904 | 8/25/2014 |
4.0.1 | 2,053 | 8/8/2014 |
4.0.0 | 2,064 | 8/3/2014 |
3.99.3-beta | 1,599 | 7/25/2014 |
3.99.2-beta | 1,465 | 7/17/2014 |
3.99.1-beta | 2,056 | 2/8/2014 |
3.2.0 | 4,450 | 12/11/2013 |
3.1.2 | 3,334 | 11/20/2013 |
3.1.1 | 15,022 | 10/12/2013 |
3.1.0 | 2,841 | 10/12/2013 |
3.0.2 | 7,712 | 8/9/2013 |
3.0.1 | 3,285 | 7/3/2013 |
3.0.0.20130620-alpha | 2,289 | 6/21/2013 |
3.0.0.20130531-alpha | 2,284 | 6/1/2013 |
3.0.0.20130519-alpha | 2,202 | 5/20/2013 |
3.0.0.20130513-alpha | 2,187 | 5/14/2013 |
2.6.12 | 3,026 | 4/1/2014 |
2.6.11 | 2,839 | 2/21/2014 |
2.6.10 | 2,817 | 1/14/2014 |
2.6.9 | 3,129 | 9/11/2013 |
2.6.8 | 3,197 | 8/22/2013 |
2.6.7 | 3,376 | 6/18/2013 |
2.6.6 | 3,956 | 5/2/2013 |
2.6.5 | 2,928 | 5/1/2013 |
2.6.4 | 3,071 | 4/2/2013 |
2.6.3 | 2,932 | 4/2/2013 |
2.6.2 | 3,072 | 3/13/2013 |
2.6.1 | 3,020 | 3/6/2013 |
2.6.0 | 3,205 | 3/5/2013 |
2.5.1 | 3,114 | 2/18/2013 |
2.5.0 | 3,101 | 2/11/2013 |
2.4.3 | 3,021 | 2/3/2013 |
2.4.1 | 2,695 | 1/14/2013 |
2.4.0 | 2,801 | 1/8/2013 |
2.3.1 | 2,781 | 1/8/2013 |
2.3.0 | 2,057 | 12/26/2012 |
2.2.2 | 1,987 | 12/20/2012 |
2.2.1 | 2,022 | 12/20/2012 |
2.2.0 | 1,928 | 12/20/2012 |
2.0.0 | 2,253 | 11/3/2012 |
1.0.1 | 2,491 | 4/28/2012 |
1.0.0 | 2,358 | 4/28/2012 |