Menu

1 / 2

Why Squirix shed its web stack

DEV Community: csharp·Alex E·12 days ago
#Y1JKPcV1
#devtocsharp#devto#dev#server#squirix
Long article (796 words) — no AI summary yet.
Reading 0:00
15s threshold

Why Squirix shed its web stack

The first versions of Squirix, a distributed cache for .NET, ran as an ASP.NET Core app. Kestrel accepted connections, and a shared .proto file told the C# client and server how to talk to each other over gRPC. That saved me time when I was working out which replica could safely acknowledge a write.

For 0.2.0-preview.1 , I wanted to look at a cheaper operation: reading a short string that's already in memory. Even on a cache hit, the server has to decode the request, look up the key and send the value back. I wanted to be able to change how Squirix did that last part, right down to when it flushed the connection.

The change happened in stages. For a while, Squirix was running a binary protocol over TLS, hosted by Kestrel, with Protobuf still encoding the messages.

Four reads on one connection

The SDK was the first piece to move off gRPC. Consider what happens when four small reads finish on the same connection.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.