Skip to main content

Posts

Showing posts from July, 2023

SQLite Cache Extension for Dotnet

The SQLite Caching Library is layer for caching data on SQLite to be used as a secondary database in case of failures and network inconsistences. Example of architecture How This caching library is based on the "Microsoft.Extensions.Caching.Redis" for memory caching, but instead of using Redis it uses the SQLite as a data layer. The ideia is to be a library for persistence cache in case of failures. This library uses the "Microsoft.Data" and acts as a layer above the SQLite. Usage The initialization can be either by using Microsoft's dependency injection or a common initialization. Common Initialization var cache = new SQLiteCache(options => { options.Location = @"c:\cache\database.sqlite"; }); Dependency Injection The commom initialization requires to always declare a new SQLiteCache instance and it can be consuming, depending on how many time do you need to cache data. There is why it is available the dependency injection l

Translate