PersistX 1.0.0
dotnet add package PersistX --version 1.0.0
NuGet\Install-Package PersistX -Version 1.0.0
<PackageReference Include="PersistX" Version="1.0.0" />
<PackageVersion Include="PersistX" Version="1.0.0" />
<PackageReference Include="PersistX" />
paket add PersistX --version 1.0.0
#r "nuget: PersistX, 1.0.0"
#:package PersistX@1.0.0
#addin nuget:?package=PersistX&version=1.0.0
#tool nuget:?package=PersistX&version=1.0.0
<div align="center"> <img src="assets/PersistX.png" alt="PersistX Logo" width="200"/>
PersistX
A high-performance persistent collection library for .NET with ACID transactions, indexing, and advanced data structures.
๐ฏ Overview
PersistX is a next-generation replacement for simple file-based persistent collections. Unlike existing libraries, PersistX supports scalability, performance, transactions, indexing, async APIs, and advanced collection types, making it feel like a mini embedded database engine but with collection-first abstractions.
โจ Features
โ Implemented (v1.0.0)
- File-Based Collections: Easy-to-use persistent collections (List, Dictionary, Set)
- Database Collections: Enterprise-grade collections with advanced features
- Storage Backends: File, In-Memory, and SQLite storage
- Transaction Support: ACID transactions with savepoints
- Indexing: Hash-based indexes for fast lookups
- Serialization: JSON serialization support
- Async APIs: Full async/await support throughout
- Batch Operations: High-performance bulk operations
- Performance Optimized: Optimized for large datasets
๐๏ธ Project Structure
PersistX/
โโโ FileBased/ # File-based, standalone collections
โ โโโ PersistentList.cs
โ โโโ PersistentDictionary.cs
โ โโโ PersistentSet.cs
โโโ Database/ # Database operations and management
โ โโโ Database.cs
โ โโโ DatabaseFactory.cs
โ โโโ TransactionManager.cs
โโโ Collections/ # Database-integrated collections
โ โโโ PersistentCollection.cs
โโโ Indexes/ # Indexing system
โ โโโ HashIndex.cs
โโโ Storage/ # Storage backends
โ โโโ FileStorage.cs
โ โโโ MemoryStorage.cs
โ โโโ SQLiteStorage.cs
โโโ Serialization/ # Serialization
โ โโโ JsonSerializer.cs
โโโ Interfaces/ # Core interfaces
โโโ IPersistentCollection.cs
โโโ IDatabase.cs
โโโ IBackend.cs
โโโ IIndex.cs
โโโ ISerializer.cs
๐ Quick Start
๐ฆ Installation
Package Manager Console
Install-Package PersistX
.NET CLI
dotnet add package PersistX
PackageReference (csproj)
<PackageReference Include="PersistX" Version="1.0.0" />
Direct Download
File-Based Collections (Quick & Easy)
using PersistX.FileBased;
// Create a persistent list
var tasks = new PersistentList<string>("tasks.json");
await tasks.AddAsync("Complete project");
await tasks.AddAsync("Review code");
// Create a persistent dictionary
var settings = new PersistentDictionary<string, object>("settings.json");
await settings.SetAsync("theme", "dark");
await settings.SetAsync("notifications", true);
// Create a persistent set
var tags = new PersistentSet<string>("tags.json");
await tags.AddAsync("work");
await tags.AddAsync("urgent");
Database Collections (Enterprise Features)
using PersistX.Database;
using PersistX.Collections;
// Create a database
var database = await DatabaseFactory.CreateFileDatabaseAsync("MyApp", "app.db");
// Create a collection with indexes
var users = await database.CreateCollectionAsync<User>("users");
await users.CreateIndexAsync("email_index", u => u.Email);
await users.CreateIndexAsync("name_index", u => u.Name);
// Add users with transactions
await database.ExecuteInTransactionAsync(async transaction =>
{
await users.AddAsync(new User { Name = "John", Email = "john@example.com" });
await users.AddAsync(new User { Name = "Jane", Email = "jane@example.com" });
});
// Search using indexes
var emailIndex = await users.GetIndexAsync<string>("email_index");
await foreach (var user in emailIndex.FindAsync("john@example.com"))
{
Console.WriteLine($"Found: {user.Name}");
}
๐ File Storage
File-Based Collections
- Default Path:
./persistx_data/
(relative to application) - Custom Path: Specify full path in constructor
- File Format: JSON files (
.json
)
Database Collections
- Default Path:
./persistx_data/
(relative to application) - Custom Path: Specify full path in
DatabaseFactory.CreateFileDatabaseAsync()
- File Format: Database files (
.db
) with metadata
Example Paths
// File-based collections
var list = new PersistentList<string>("C:/MyApp/data/tasks.json");
// Database collections
var db = await DatabaseFactory.CreateFileDatabaseAsync("MyApp", "C:/MyApp/data/app.db");
๐งช Testing & Examples
Run the test console application to see all features in action:
cd src/PersistX.Test
dotnet run
The test application includes:
- File-Based Collections Demo: Basic operations and file management
- Database Collections Demo: Advanced features, transactions, and indexing
- Performance Tests: Bulk operations and performance benchmarks
- Real-World Examples: Shopping cart, blog system, inventory management
๐ Documentation
- Detailed Examples: Comprehensive usage examples and patterns
- Development Roadmap: Future features and development plans
๐ฆ NuGet Package
<PackageReference Include="PersistX" Version="1.0.0" />
Package Structure
- PersistX: Core library with all features
- PersistX.FileBased: File-based collections only (lightweight)
- PersistX.Database: Database collections only (enterprise)
๐ค Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with .NET 9.0
- Inspired by modern database design principles
- Community feedback and contributions
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net9.0
- Microsoft.Data.Sqlite (>= 9.0.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
- System.IO.Compression (>= 4.3.0)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 9.0.8)
- System.Threading.Channels (>= 9.0.8)
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 |
---|---|---|
1.0.0 | 155 | 9/7/2025 |