dotnet add package --version 14.5.7
NuGet\Install-Package -Version 14.5.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="" Version="14.5.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add --version 14.5.7
#r "nuget:, 14.5.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install as a Cake Addin
#addin nuget:?

// Install as a Cake Tool
#tool nuget:?

NoSQL based IO, caching, and logging adapters for Hyperlambda

This project contains alternative NoSQL file system services, implementing IFileService, IFolderService, and IStreamService, allowing you to use it as an interchangeable "virtual file system" for cases where you want to have 100% stateless magic instances. This is important if you're using Magic in a Kubernetes cluster or something similar, load balancing invocations, virtually resolving files and folders towards a virtual file system. If you take this path you'll have to configure your "appsettings.json" file such as illustrated further down in this document. The project also contains an ILogger implementation service you can use that will create log entries in a NoSQL based storage of your choice, in addition to an IMagicCache implementation service allowing you to use a NoSQL based out of process cache implementation. See further down in this document for details about how to configure these parts.


The primary configuration for the project to apply for your "appsettings.json" file can be found below. Notice, although you can create as many NoSQL cluster connection settings as you wish, and use these in your own code, the IO, caching, and logging services requires you to use generic as your cluster name, and you cannot change this.

  "magic": {
    "cql": {
      "generic": {
        "host": "",
        "credentials": {
          "username": "xxx",
          "password": "xxx"
        "port": 12345

Notice - The "credentials" parts above are optional, and can be ommitted if you don't require authentication to connect to your database. You can also provide multiple hosts as contact points, by separating multiple IP addresses or hosts by a comma (,). The above "port" parts is also optional.

The above configures the adapter to use as the host for your contact point or cluster. To configure the adapter to store files and folders inside of its CQL based database, you can alternatively add something such as follows to your "appsettings.json" file.

  "magic": {
    "io": {
      "file-service": "",
      "folder-service": "",
      "stream-service": ""

Notice - This project also includes a "mixed" service implementation, storing system files and folders in the file system while storing dynamic files and folders in a NoSQL database of your choice. These can be found in the same namespace, but are named "MixedXXX" instead of using the above names.

If you want to use a CQL based log implementation, you'll have to configure Magic to use the NoSQL ILogger service such as follows.

  "magic": {
    "logging": {
      "service": ""

If you want to use a CQL based caching implementation, you'll have to configure Magic to use the NoSQL IMagicCache service such as follows.

  "magic": {
    "caching": {
      "service": ""


To use the alternative CQL based file storage system you'll have to create your "magic_files" keyspace and its "files" table as follows.

create keyspace if not exists magic_files with replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 5 };

use magic_files;

create table if not exists files(
   tenant text,
   cloudlet text,
   folder text,
   filename text,
   content blob,
   primary key((tenant, cloudlet), folder, filename));

To use the alternative CQL based logging implementation you'll have to create your "magic_log" keyspace and its "log" table as follows.

create keyspace if not exists magic_log with replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 3 };

use magic_log;

create table if not exists log(
   tenant text,
   cloudlet text,
   created timeuuid,
   type text,
   content text,
   exception text,
   meta frozen<map<text, text>>,
   primary key((tenant, cloudlet), created)) with clustering order by (created desc);

alter table log with default_time_to_live = 1209600;

Notice - The above setting for TTL implies log items will be automatically evicted after 14 days, since 1,209,600 seconds implies 14 days. Depending upon your needs you might want to increase or decrease this setting. However, to avoid exhausting your hard drive space over time on your server, we suggest you do not entirely remove the TTL setting.

To use the alternative CQL based caching implementation you'll have to create your "magic_cache" keyspace and its "cache" table as follows.

create keyspace if not exists magic_cache with replication = { 'class': 'NetworkTopologyStrategy', 'replication_factor': 3 };

use magic_cache;

create table if not exists cache(
   tenant text,
   cloudlet text,
   key text,
   value text,
   primary key((tenant, cloudlet), key));

Adding existing files into NoSQL database

The following Hyperlambda will insert all your existing files and folders into your cluster keyspace, allowing you to play around with an existing CQL file system implementation. Notice, you'll have to change the [.tenant] and [.cloudlet] values to resemble the absolute root folder for your Magic backend. The values in the file below is obviously just an example of how it might look like if you've got the files on a Mac within your "Documents" folder. The "tenant" and the "cloudlet" parts are resolved by doing a string split operation on your magic:io:root-files root folder upon the last (/) found in your folder - Implying if you use the Docker images with the default configuration the "tenant" part would become "magic" and the "cloudlet" part would become "files", since the Docker images stores files within the "/magic/files/" folder.

 * Inserts all dynamic files and folders into the magic CQL database.

    * The root folder where your Magic backend is running.

    * Inserting root folder.
   cql.execute:"insert into files (tenant, cloudlet, folder, filename) values (:tenant, :cloudlet, '/files/', '')"

    * Inserting appsettings.json and its folder.
   cql.execute:"insert into files (tenant, cloudlet, folder, filename, content) values (:tenant, :cloudlet, '/config/', 'appsettings.json', :config)"
   cql.execute:"insert into files (tenant, cloudlet, folder, filename) values (:tenant, :cloudlet, '/config/', '')"

    * Inserting folders.

      cql.execute:"insert into files (tenant, cloudlet, folder, filename) values (:tenant, :cloudlet, :folder, '')"

    * Inserting files.

      cql.execute:"insert into files (tenant, cloudlet, folder, filename, content) values (:tenant, :cloudlet, :folder, :filename, :content)"



This project is created to be a multi-tenant solution, implying multiple users, and/or cloudlets, can use the same physical database for both files, log entries, and cache entries. However, this implies you are able to correctly resolve the "tenant" parts and the "cloudlet" parts for all the above tables. How to achieve this is currently beyond the scope of this document, but our suggestion is to create some sort of IRootResolver service implementation that is dynamically created according to the Host HTTP header of requests.

Project website

The source code for this repository can be found at, and you can provide feedback, provide bug reports, etc at the same place.

Quality gates

  • Build status
  • Quality Gate Status
  • Bugs
  • Code Smells
  • Coverage
  • Duplicated Lines (%)
  • Lines of Code
  • Maintainability Rating
  • Reliability Rating
  • Security Rating
  • Technical Debt
  • Vulnerabilities
Product 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 was computed.  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. 
.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 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
14.5.7 451 12/13/2022
14.5.5 519 12/6/2022
14.5.1 442 11/23/2022
14.5.0 408 11/18/2022
14.4.5 490 10/22/2022
14.4.1 408 10/22/2022
14.4.0 441 10/17/2022
14.3.1 575 9/12/2022
14.3.0 383 9/10/2022
14.1.3 667 8/7/2022
14.1.2 405 8/7/2022
14.1.1 390 8/7/2022
14.0.14 454 7/26/2022
14.0.12 433 7/24/2022
14.0.11 403 7/23/2022
14.0.10 412 7/23/2022
14.0.9 395 7/23/2022
14.0.8 486 7/17/2022
14.0.5 540 7/11/2022
14.0.4 669 7/6/2022
14.0.3 642 7/2/2022
14.0.2 588 7/2/2022
14.0.0 801 6/25/2022
13.4.0 2,002 5/31/2022
13.3.4 1,375 5/9/2022
13.3.1 666 5/1/2022
13.3.0 632 5/1/2022
13.2.0 1,125 4/21/2022
13.1.0 982 4/7/2022
13.0.0 666 4/5/2022
11.0.5 1,357 3/2/2022
11.0.4 702 2/22/2022
11.0.3 692 2/9/2022
11.0.2 717 2/6/2022
11.0.1 714 2/5/2022
10.0.21 715 1/28/2022
10.0.20 692 1/27/2022
10.0.19 690 1/23/2022