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.…