![]() |
VOOZH | about |
dotnet add package Stellar.FastDB --version 1.1.1
NuGet\Install-Package Stellar.FastDB -Version 1.1.1
<PackageReference Include="Stellar.FastDB" Version="1.1.1" />
<PackageVersion Include="Stellar.FastDB" Version="1.1.1" />Directory.Packages.props
<PackageReference Include="Stellar.FastDB" />Project file
paket add Stellar.FastDB --version 1.1.1
#r "nuget: Stellar.FastDB, 1.1.1"
#:package Stellar.FastDB@1.1.1
#addin nuget:?package=Stellar.FastDB&version=1.1.1Install as a Cake Addin
#tool nuget:?package=Stellar.FastDB&version=1.1.1Install as a Cake Tool
Stellar.FastDB is an exceptionally fast document store for C# with speeds approximately 100x faster than similar products. Designed for optimal performance and high concurrency, it excels in embedded workflows that demand efficiency.
👁 image
Throughput (Records Per Second - Higher is Better)
Key Features
It's essentially a ConcurrentDictionary with built-in persistence.
A detailed list of benchmarks, along with a reproducible project, is available.
| Method | Product | Op/s | FileSize |
|---|---|---|---|
| Insert 10,000 | <ins>FastDB</ins> | 192,855 | 653 KB |
| Insert 10,000 | VistaDB | 2,648 | 940 KB |
| Insert 10,000 | LiteDB | 1,251 | 1,656 KB |
| Insert 10,000 | SQLite | 753 | 444 KB |
| Method | Product | Op/s | FileSize |
|---|---|---|---|
| Delete 10,000 | <ins>FastDB</ins> | 164,177 | 653 KB |
| Delete 10,000 | VistaDB | 5,503 | 940 KB |
| Delete 10,000 | LiteDB | 1,207 | 1,664 KB |
| Delete 10,000 | SQLite | 757 | 444 KB |
| Method | Product | Op/s | FileSize |
|---|---|---|---|
| Upsert 10,000 | <ins>FastDB</ins> | 93,633 | 653 KB |
| Upsert 10,000 | LiteDB | 3,192 | 1,664 KB |
| Upsert 10,000 | VistaDB | 2,372 | 940 KB |
| Upsert 10,000 | SQLite | 741 | 444 KB |
| Method | Product | Op/s | FileSize |
|---|---|---|---|
| Bulk 10,000 | SQLite | 294,455 | 444 KB |
| Bulk 10,000 | <ins>FastDB</ins> | 226,075 | 653 KB |
| Bulk 10,000 | LiteDB | 44,219 | 8 KB |
| Bulk 10,000 | VistaDB | 2,706 | 952 KB |
| Method | Product | Op/s | FileSize |
|---|---|---|---|
| Query 10,000 | <ins>FastDB</ins> | 12,080,699 | 653 KB |
| Query 10,000 | SQLite | 2,227,601 | 444 KB |
| Query 10,000 | VistaDB | 574,299 | 940 KB |
| Query 10,000 | LiteDB | 497,798 | 1,656 KB |
Why was Stellar.FasbDB created?
As a game developer, I need a high-concurrency storage solution for player-managed game servers. Requiring players to install local databases isn’t practical. However, most available storage options are either too slow or struggle with concurrent reads and writes. These limitations make them unsuitable for game servers, which require high volume reads and writes without performance issues.
Should I use Stellar.FastDB?
Use Stellar.FastDB if you need:
Do not use this database if you need:
What additional features are planned for Stellar.FastDB?
Below is a basic example demonstrating how to interact with Stellar.FastDB. This includes creating a database instance, storing customer data, updating it, retrieving it, and properly closing the database connection:
// create a class
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime DOB { get; set; }
public string Phone { get; set; }
public bool IsActive { get; set; }
}
// create database
FastDB fastDB = new FastDB();
// create a collection (key, value)
var customers = fastDB.GetCollection<int, Customer>();
// create your new customer instance
var customer = new Customer
{
Id = 1,
Name = "John Wick",
Phone = "555-555-5555"
DOB = new DateTime(2000, 1, 1)
IsActive = true
};
// add customer
customers.Add(customer.Id, customer);
// update customer
customer.Name = "John Wick's Dog";
customers.Update(customer);
// use LINQ to query
var matches = customers.Where(a => a.Name.StartsWith("John") && a.Phone != null);
// close database
fastDB.Close();
FastDBOptions options = new FastDBOptions()
{
IsEncrypted = true,
EncryptionPassword = "open-sesame",
};
FastDB fastDB = new FastDB(options);
FastDBOptions options = new FastDBOptions()
{
IsCompressed = true,
};
FastDB fastDB = new FastDB(options);
For operations involving serialization, compression, or encryption of large records, enabling parallel data transformations can significantly enhance throughput. This method uses multiple processor cores to accelerate write operations.
FastDBOptions options = new FastDBOptions()
{
BufferMode = BufferModeType.WriteParallelEnabled,
MaxDegreesOfParallelism = 8,
IsEncryptionEnabled = true,
EncryptionPassword = "open-sesame",
IsCompressed = true,
};
FastDB fastDB = new FastDB(options);
| Method | Product | Op/s | FileSize |
|---|---|---|---|
| Large | <ins>FastDB</ins> | 140,470 | 20,096 KB |
| Large Encrypted | <ins>FastDB</ins> | 100,435 | 20,205 KB |
| Large Encrypted Compressed | <ins>FastDB</ins> | 68,064 | 14,892 KB |
| Large Enc Cmp Parallel | FastDB | 138,588 | 14,892 KB |
To achieve the smallest possible storage footprint, Stellar.FastDB supports serialization contracts using MessagePack. By adding MessagePack attributes to your data models (as shown in the example below), you can instruct the serializer to package the data more efficiently. Note that this feature is disabled by default and is typically not included in most benchmarks.
// create a class
public class Customer
{
[Key(0)]
public int Id { get; set; }
[Key(1)]
public string Name { get; set; }
[Key(2)]
public DateTime DOB { get; set; }
[Key(3)]
public string Phone { get; set; }
[Key(4)]
public bool IsActive { get; set; }
}
FastDBOptions options = new FastDBOptions()
{
Serializer = SerializerType.MessagePack_Contract,
};
FastDB fastDB = new FastDB(options);
// create a collection (key, value)
var customers = fastDB.GetCollection<int, Customer>();
// add customer
customers.Add(customer.Id, customer);
customres.Flush()
// close database
fastDB.Close();
| Serializer | Product | Op/s | FileSize |
|---|---|---|---|
| Default 10,000 | <ins>FastDB</ins> | 198,628 | 653 KB |
| Contract 10,000 | <ins>FastDB</ins> | 201,109 | 370 KB |
I may be contacted on the Stellar Conquest Discord (stonstad) and X (stonstad).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Stellar.FastDB:
| Package | Downloads |
|---|---|
|
GoLive.Saturn.Data.Stellar
An experimental Rapid Prototype Development Framework in c#/.net core. |
|
|
Serilog.Sinks.FastDB
A Serilog sink for Stellar.FastDB, an embeddable key-value store. |
This package is not used by any popular GitHub repositories.