RSSAmplifier

Blog

MysticMind.dev

Thoughts on software architecture, .NET, open source, and building things that last. By Babu Annamalai.

mysticmind.devRSS feed ↗28 posts

Latest posts

Practical RAG with Marten and pgvector, Part 1: Semantic Search over Movie Plots

Build semantic search and a small RAG pipeline over 42,000 movie plots using nothing but Postgres. Marten's new pgvector package stores and searches the embeddings, Ollama generates them locally, and there is not an API key in sight.

Practical RAG with Marten and pgvector, Part 2: A Q&A Assistant for the Marten Docs

Turn the same Marten + pgvector + Ollama stack from Part 1 into a question-answering assistant over the Marten documentation. The new ingredient is chunking: splitting long markdown pages into retrievable passages, then citing the exact page each answer draws from.

Dynamic Consistency Boundary in Marten, Part 1: The aggregate trap

The structural problem DCB solves: business rules that span multiple aggregates and cannot be defended by per-stream optimistic concurrency.

Dynamic Consistency Boundary in Marten, Part 2: Implementation with plain Marten

We build the coupon redemption command from Part 1 using Marten's DCB API: tag types, BoundaryAggregate, FetchForWritingByTags, and the explicit ConcurrencyException retry cycle.

Dynamic Consistency Boundary in Marten, Part 3: Less ceremony with Wolverine

We rebuild the redemption command from Part 2 using Wolverine.HTTP with a [WolverinePost] endpoint, where the HTTP route, the DCB consistency boundary, and the business decision live in one static method. Includes an Alba HTTP test.

Dynamic Consistency Boundary in Marten, Part 4: Production considerations

Tag storage modes, the global-lock failure mode of over-broad queries, tag governance, schema evolution, incremental migration from existing aggregates, and when DCB is the wrong tool.

Postgres point-in-time recovery with pgBackRest and S3-compatible storage

Set up pgBackRest against S3-compatible object storage (MinIO as the open source example), then recover Postgres to any moment in the past, including the second before someone ran a bad DELETE.

ReverseMarkdown 5.0.0 released: 200× Performance Boost for HTML to Markdown conversion

ReverseMarkdown 5.0.0 is out! It’s our biggest leap in years - dramatically faster, more resilient on edge cases, and friendlier .NET HTML to Markdown converter library. Upto to 200× faster on huge HTML via TextWriter refactor. Fixed nested exp...

Creating a single universal shared lib or executable file for macOS Intel and Silicon using lipo

As macOS developers, creating universal binaries and shared libraries that work seamlessly across both Intel (x86_64) and Apple Silicon (arm64) architectures is critical. Whether you’re building standalone executables or .so` shared libraries, combin...

Encrypting and crypto-shredding of PII data in Marten documents using HashiCorp Vault

Protecting Personally Identifiable Information (PII) has become essential as organizations handle increasing volumes of sensitive data. Regulations like the GDPR (General Data Protection Regulation) mandate strict controls over PII to safeguard indiv...

Encrypting Personally Identifiable Information at rest in Marten documents

Protecting Personally Identifiable Information (PII) has become essential as organizations handle increasing volumes of sensitive data. Regulations like the GDPR (General Data Protection Regulation) mandate strict controls over PII to safeguard indiv...

Personally Identifiable Information masking in Marten documents using partial update/patching

Protecting Personally Identifiable Information (PII) has become essential as organizations handle increasing volumes of sensitive data. Regulations like the GDPR (General Data Protection Regulation) mandate strict controls over PII to safeguard indiv...

Understanding the internals of Marten native partial updates using Postgres PL/pgSQL.

This is a continuation of the Marten native partial updates patching post. All the native patch operations are driven by a bunch of custom PL/pgSQL functions with prefix mt_jsonb_. Marten uses JSONB for all its JSON storage hence all th...

Understanding the :? Parameter Expansion in Bash

When writing shell scripts, ensuring that certain variables are set and not empty is crucial. One handy feature in Bash for this purpose is the :? parameter expansion. The :? syntax is a form of parameter expansion in Bash that allows you to check if...

A guide to handling Bash script with positional arguments

Bash scripts often require the ability to process both positional and named (or optional) arguments. Understanding how to handle these types of arguments can greatly enhance the flexibility and functionality of your scripts. Bash provides several spe...

Calling nested shell scripts: same process or in different process

In Unix-like operating systems, shell scripts can be called from within other shell scripts, either to run in the same process or in a different process. Let's explore both approaches. Let us create a bash script named task.sh with the content below ...

Convert HTML table with colspan to Markdown

An interesting issue was raised in my ReverseMarkdown GitHub library repository wherein conversion of HTML table containing colspan in cells does not convert properly to Markdown. Let me show you a representative example of the HTML table content for...

Marten native partial updates - patching

Partial update or patching JSON involves making changes to specific parts of a JSON document without replacing the entire document. This is particularly useful when you only need to modify certain fields or elements within a large JSON object, rather...

How to use SQLite db as an embedded resource in .NET

I was quite intrigued by the recent version of [Bun](https://bun.sh/docs/bundler/executables#embedding-sqlite-databases) supporting a one liner call to embed a SQLite file and use it as part of a single file binary. This is super cool. See the code b...

Exploring cross-platform single-file app development using Golang

To set some context, the app itself will need to provide the following functionality Web app serving few web pages and also serves a REST API. CLI based task/commands to do various tasks including serving the web app. Deploy as a single-file binar...

MysticMind.PostgresEmbed v4.0 released

MysticMind.PostgresEmbed v4.0 released with support for .NET 8 and few enhancements. This library provides minimum Postgres binaries for development or unit testing purposes. This library has had around 92K NuGet downloads so far. https://github.com/...

Running OSS Large Language Models locally with Ollama

Ollama is a really easy and sleek tool to run OSS large language models. Download the Ollama app from https://ollama.ai, run it. Once you run, it spins up and API and you can use the CLI to install models and ask your questions. You can lookup all th...

How to create a cross platform zip archive using GitHub Actions

Let me set some context to understand the problem at hand, zip command is available by default on all *nix OS flavours which includes both Linux and Mac OS. On latest Windows server, there is no zip as command readily available but GH Actions provide...

How to create unique file names in bash shell

For debugging purposes, we had to profile a Python program using cProfile which will create a .prof file with the profiled data. Also, we wanted to create unique file names for each run using a bash shell. We had a couple of options: Use Unix epoch ...

VitePress fenced code block syntax highlighting quirks with .NET or other languages.

VitePress uses Shiki for syntax highlighting which is a fantastic library. Shiki automatically fetches language grammar from VSCode so the language names etc for the fenced code block comes from it. For .NET, the language names captured are csharp a...

How to keep .NET documentation code samples in sync with code base

Maintaining and managing documentation for software products or libraries require a good amount of time and discipline to keep it up to date with the latest code base. Typically code samples are the ones which can quickly go out of sync when it is ma...

.NET build tool using Bullseye and SimpleExec

NAnt was quite a popular build tool used by projects of all sizes targeting .NET Framework on Windows. I have written many complex build systems using NAnt in the past. But XML based DSL was quite clunky to use and maintain. Besides, it was always a ...

GitHub action to publish .NET packages to NuGet

I have been a co-maintainer of .NET OSS library Marten and largely involved in taking care of the DevOps stuff pertaining to CI pipeline, build and docs system. In the early days, the build was driven using a RAKE build script written by Jeremy Mille...