FastIngest.Core 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FastIngest.Core --version 0.1.0
                    
NuGet\Install-Package FastIngest.Core -Version 0.1.0
                    
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="FastIngest.Core" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FastIngest.Core" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FastIngest.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FastIngest.Core --version 0.1.0
                    
#r "nuget: FastIngest.Core, 0.1.0"
                    
#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.
#:package FastIngest.Core@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FastIngest.Core&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FastIngest.Core&version=0.1.0
                    
Install as a Cake Tool

FastIngest

CI/CD License: MIT NuGet

FastIngest is a high-throughput, constant-memory bulk ingestion pipeline for .NET (CSV/XLSX to PostgreSQL, SQL Server, and MongoDB). Designed for enterprise workloads processing millions of rows without memory spikes, FastIngest leverages zero-allocation streaming readers, fluent validation, and native database bulk protocols (such as PostgreSQL binary COPY, SQL Server SqlBulkCopy, and MongoDB unordered BulkWriteAsync).


Architecture Overview

FastIngest processes incoming tabular data using a pipeline pattern that keeps memory usage constant regardless of file size:

Stream (CSV / XLSX)
        │
        ▼
┌───────────────────────────────┐
│ Sylvan Zero-Allocation Reader │  <-- Constant-memory row streaming
└──────────────┬────────────────┘
               │
               ▼
┌───────────────────────────────┐
│ Expression-based Mapper       │  <-- Strongly-typed record mapping
└──────────────┬────────────────┘
               │
               ▼
┌───────────────────────────────┐
│ FluentValidation Engine       │  <-- FailFast or CollectAndContinue
└──────────────┬────────────────┘
               │
               ▼
┌───────────────────────────────┐
│ Batch Buffering & Partitioning│  <-- Configurable batch chunks (e.g. 5,000)
└──────────────┬────────────────┘
               │
               ▼
┌───────────────────────────────┐
│ Native Database COPY Sink     │  <-- PostgreSQL Binary COPY FROM STDIN
└───────────────────────────────┘

Key Features

  • Constant-Memory Streaming: Stream arbitrarily large files (gigabytes to tens of gigabytes) with fixed memory footprint.
  • Native Database COPY: High-speed binary ingestion utilizing PostgreSQL COPY ... FROM STDIN (FORMAT BINARY).
  • Validation Strategies:
    • FailFast: Immediately halts ingestion on the first invalid record.
    • CollectAndContinue: Collects invalid row details and exports an error report CSV while allowing valid records to proceed.
  • Fluent Pipeline API: Composable, chainable pipeline configuration with progress tracking.
  • SemVer 2.0 Driven by Git Tags: Automated versioning via MinVer and seamless CI/CD publishing.

Quickstart

1. Installation

dotnet add package FastIngest.Core
dotnet add package FastIngest.PostgreSql

2. Define Record & Validator

using FluentValidation;

public record CustomerRecord(int Id, string Email, string FullName, decimal Balance);

public class CustomerValidator : AbstractValidator<CustomerRecord>
{
    public CustomerValidator()
    {
        RuleFor(x => x.Email).NotEmpty().EmailAddress();
        RuleFor(x => x.FullName).NotEmpty().MaximumLength(100);
        RuleFor(x => x.Balance).GreaterThanOrEqualTo(0);
    }
}

3. Run Pipeline with PostgreSQL COPY

using FastIngest.Core.Common;
using FastIngest.Core.Pipeline;
using FastIngest.PostgreSql.Extensions;
using Npgsql;

await using var stream = File.OpenRead("large_customers.csv");
await using var connection = new NpgsqlConnection("Host=localhost;Database=mydb;Username=postgres;Password=secret");
await connection.OpenAsync();

var result = await FastIngestPipeline<CustomerRecord>.Create()
    .FromStream(stream, FileType.Csv)
    .WithMapping(mapping =>
    {
        mapping.Map(x => x.Id, "customer_id");
        mapping.Map(x => x.Email, "email");
        mapping.Map(x => x.FullName, "full_name");
        mapping.Map(x => x.Balance, "balance");
    })
    .ValidateWith<CustomerValidator>(options =>
    {
        options.ErrorStrategy = ErrorStrategy.CollectAndContinue;
    })
    .WithBatchSize(5000)
    .OnProgress(progress =>
    {
        Console.WriteLine($"Processed {progress.RowsProcessed} rows ({progress.PercentComplete:F1}%)...");
    })
    .WriteToPostgresAsync(connection, "customers", CancellationToken.None);

Console.WriteLine($"Ingestion Complete! Succeeded: {result.TotalSucceeded}, Failed: {result.TotalFailed}");

if (!result.IsSuccess)
{
    var errorCsv = result.ExportErrorsToCsv();
    await File.WriteAllBytesAsync("ingest_errors.csv", errorCsv);
}

Repository Structure

├── .github/workflows/ci.yml       # GitHub Actions CI/CD Pipeline
├── Directory.Build.props          # Centralized MSBuild & MinVer configuration
├── FastIngest.sln
├── src/
│   ├── FastIngest.Core/           # Core interfaces, pipeline, and CSV parsers
│   ├── FastIngest.PostgreSql/     # PostgreSQL native binary COPY sink
│   ├── FastIngest.SqlServer/      # Microsoft SQL Server SqlBulkCopy sink
│   ├── FastIngest.MongoDb/        # MongoDB unordered BulkWrite sink
│   └── FastIngest.Extensions.DependencyInjection/ # Engine, DI, and profile registry
├── samples/
│   └── FastIngest.SampleApi/      # Minimal Web API demonstrating ingestion
└── tests/
    └── FastIngest.Tests/          # Unit and integration test suites

License

This project is licensed under the MIT License - see the LICENSE file for details.

Developed & Maintained by Paul Abib Camano (Aebibtech).

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on FastIngest.Core:

Package Downloads
FastIngest.SqlServer

SQL Server bulk copy ingestion sink for FastIngest using high-performance SqlBulkCopy.

FastIngest.Elasticsearch

Elasticsearch bulk indexing sink for FastIngest using Elastic.Clients.Elasticsearch.

FastIngest.MySql

MySQL bulk copy ingestion sink for FastIngest using high-performance MySqlBulkCopy.

FastIngest.Sqlite

SQLite batch transaction ingestion sink for FastIngest using prepared statements.

FastIngest.CosmosDb

Azure Cosmos DB bulk ingestion sink for FastIngest using transactional batches and bulk executor.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 207 10/1/2026
0.4.0 180 10/1/2026
0.3.2 182 9/26/2026
0.3.1 189 9/25/2026
0.3.0 187 9/25/2026
0.2.0 195 9/24/2026
0.1.1 180 9/24/2026
0.1.0 188 9/24/2026