Skip to main content

Tag: Rust

Automatic redaction of personal data in the browser

Let’s use the last post, on building WebAssembly browser plug-ins in Rust, to create something useful: a browser plugin that redacts personally identifiable information (PII) in real time, as a user types or pastes text. The redaction happens instantly, without the user’s data ever leaving the browser.

The best way to show this in a demo is to have the browser’s network tab open (on Chrome: menu -> more tools -> developer tools, click on network tab). Then type some text in the web demo, and show that the redaction is happening without any network traffic, so the text is getting cleaned up without leaving the browser.

Fast browser plugins with Rust and WebAssembly

WebAssembly is a secure way of building binary code that runs inside a browser, using a protected sandbox. JavaScript can talk to the plugin, but only through explicitly exposed methods, and the same is true of WebAssembly methods calling JavaScript functions from inside the plugin.

Using Rust to create WebAssembly plugins that work in a browser is not new, but I wanted to share the build chain I have been using, as it is simpler than the standard process documented by Mozilla, especially if you are not using Node.js to build your site. We’ll create a simple plugin to show the process, and in the next post we will try something more ambitious.

Give your agents fast access to your data lake

In this post, we combine the fast MCP server from the last post with the near-instantaneous queries on Parquet files from the post before that. This approach is not only fast, but good for data sovereignty and scale. With only 250 lines of code, we get a lightning-fast MCP server that puts Apache DataFusion behind a tool call, so an LLM can do analytics on enterprise-scale Parquet data without a notebook, a warehouse bill, or a single row of raw data entering the context window.

MCP servers in Rust

MCP (Model Context Protocol) servers, which make data and analytics discoverable and accessible by large language models, are built using the JSON RPC protocol, and can thus be written in Rust (or most other languages) with the standard HTTP libraries. But rmcp has become the standard way to do this, and I wanted to explore how this works, and how it can expose the fast analytics made possible by Rust. This entry shows a basic MCP server that makes it possible to get a file system directory listing, and to get some attributes of one of those files.

Fast queries on Parquet data in Rust

Several projects in banking and consumer products have made use of data stored in data lakes in Parquet, a compact and efficient column-oriented format. Python with Pandas is a feasible but very inefficient choice for this, and I have typically used Spark here. Recently revisting Rust for long-lived MCP servers, I have been exploring DataFusion for direct queries on Parquet data from Rust, and am very impressed.

DataFusion describes itself as an extensible query engine written in Rust that uses Apache Arrow as its in-memory format. The web site explains that Out of the box, DataFusion offers SQL and Dataframe APIs, excellent performance, built-in support for CSV, Parquet, JSON, and Avro, extensive customization, and a great community. It is basically a library to access these data formats and query them, either via chained declarative function calls, or via strings with SQL queries.