Aiursoft.ArrayDb.Consts 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Aiursoft.ArrayDb.Consts --version 1.0.1                
NuGet\Install-Package Aiursoft.ArrayDb.Consts -Version 1.0.1                
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="Aiursoft.ArrayDb.Consts" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Aiursoft.ArrayDb.Consts --version 1.0.1                
#r "nuget: Aiursoft.ArrayDb.Consts, 1.0.1"                
#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 Aiursoft.ArrayDb.Consts as a Cake Addin
#addin nuget:?package=Aiursoft.ArrayDb.Consts&version=1.0.1

// Install Aiursoft.ArrayDb.Consts as a Cake Tool
#tool nuget:?package=Aiursoft.ArrayDb.Consts&version=1.0.1                

Aiursoft ArrayDb

MIT licensed Pipeline stat Test Coverage ManHours

Aiursoft ArrayDb is a lightweight, efficient database engine optimized for storing fixed-length data with constant-time indexing performance (O(1)). ArrayDb is ideal for scenarios where fast, reliable storage and access to time-sequenced or resource-utilization data are essential, making it a strong choice for logging, telemetry, and performance tracking use cases.

Key Design Principles of ArrayDb

Unlike traditional databases, which can struggle with high-frequency data storage requirements, ArrayDb is purpose-built for append-only, fixed-length data storage. It stores entries as continuous, fixed-length data blocks, optimized for minimal read/write operations, ensuring high performance on both SSDs and HDDs.

ArrayDb organizes data into two categories:

  1. Fixed-Length Attributes: These attributes, such as integers, DateTime, and booleans, are stored in a fixed-length array, facilitating fast O(1) access by index.
  2. Variable-Length Attributes: For data like strings, ArrayDb maintains a separate variable-length array, where each entry contains a pointer in the fixed-length array for fast access.

Advantages of ArrayDb

  1. High-Speed Access: ArrayDb stores each element sequentially on disk. By calculating an element’s exact location based on its index, ArrayDb can retrieve or count elements in constant time, O(1).
  2. Optimized Append Performance: New entries are simply appended, which maintains data consistency and reduces disk fragmentation. This approach also ensures sustained high-speed write performance, even under heavy load.
  3. Efficient Reads: Reading from ArrayDb only requires a single disk operation to load all columns in an entry, which contrasts with traditional columnar storage that performs multiple reads for each column.

Limitations

ArrayDb is designed for simplicity and speed but with limited data manipulation:

  • No Structural Modifications: The structure of stored data cannot be edited after creation.
  • Append-Only: Supports only appending new entries; no item deletions or mid-array insertions are allowed.
  • Limited Updates: Modifying variable-length data (e.g., resizing strings) is not supported.

Best Use Cases for ArrayDb

  • Fixed-Length Data: Suitable for storing time-series data, such as CPU or memory usage metrics.
  • Time-Based Indexing: Ideal for sequential logging or telemetry data, where entries are naturally appended and queried by timestamp.

Read-Write Performance Difference

Large-scale writes are significantly faster than reads because ArrayDb optimizes writes by pre-arranging data (including strings) in memory. This enables sequential, continuous writes to disk, minimizing disk-seeking time to O(1).

In contrast, reads require accessing each string or variable-length attribute individually, creating random access patterns due to potential data fragmentation. As a result, reading incurs a higher O(n) disk-seeking time, where n is the element count. ArrayDb uses an LRU cache to reduce physical disk reads, but in multi-threaded reads, this cache introduces high CPU load.

How to use ArrayDb

Unlike MySQL, working as a process, ArrayDb works as a library. You can use ArrayDb in your C# project by adding the ArrayDb NuGet package to your project.

mkdir LearnArrayDb
cd LearnArrayDb
dotnet new console
dotnet add package Aiursoft.ArrayDb.Partitions

That's it. Now you have ArrayDb in your project. You can start using it by creating a new Partition object.



## How to contribute

There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.

Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.

We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Aiursoft.ArrayDb.Consts:

Package Downloads
Aiursoft.ArrayDb.FilePersists

Nuget package of 'FilePersists' provided by Aiursoft

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.21 160 12/11/2024
1.0.20 155 11/30/2024
1.0.19 140 11/21/2024
1.0.18 167 11/15/2024
1.0.17 131 11/13/2024
1.0.15 138 11/12/2024
1.0.14 130 11/12/2024
1.0.13 145 11/7/2024
1.0.12 134 11/6/2024
1.0.2 149 11/3/2024
1.0.1 159 11/3/2024
1.0.0 119 10/27/2024