Rebuilding the trading engine in Rust. Today: how to define the types on the data streams.
Option A: hand-write them everywhere.
Option B: protobuf + Buf, generated at build time.
I went with B. Hand-written types drift. Generated ones can't — and so far it's faster.
We experimented with TypeSafe AI's Jev the only way we know how: using Protobuf. That turned into protoc-gen-jev, an experimental plugin that generates typed Jev clients for Go, TypeScript, and Python.
https://t.co/kq7QQb4kgv
@NomadDeveloper I believe this is what you're looking for:
https://t.co/x7YWbOM8vq
Headers can still be accessed and modified for requests and responses, just using context.Context instead of the generic Request and Response types.
connect-go v2 is here.
We took four years of production experience and redesigned the API: simpler method signatures (no more generic Request/Response wrappers), pluggable transports, a unified interceptor model, and a migration tool to automate the upgrade.
Learn more: https://t.co/dyT5VveT1C
We've all seen countless "gRPC vs REST" posts filled with advice about how REST is good for public/browser-facing APIs and gRPC is good for internal APIs and services.
These discussions often miss the better third option: both. With Connect, you get browser-friendly APIs, a choice of JSON or binary Protobuf, and no binary framing weirdness for unary calls. You keep the schema and generated clients, and browsers can call the same server as your existing gRPC clients. No gateway required.
Interested? Try out ConnectRPC and read more in this week's blog post.
https://t.co/dljz8EOJBP
We've all seen countless "gRPC vs REST" posts filled with advice about how REST is good for public/browser-facing APIs and gRPC is good for internal APIs and services.
These discussions often miss the better third option: both. With Connect, you get browser-friendly APIs, a choice of JSON or binary Protobuf, and no binary framing weirdness for unary calls. You keep the schema and generated clients, and browsers can call the same server as your existing gRPC clients. No gateway required.
Interested? Try out ConnectRPC and read more in this week's blog post.
https://t.co/dljz8EOJBP
we just migrated our gRPC services to the ConnectRPC protocol instead. this turned out to be a fairly simple migration, but unlocks a whole bunch of new features for Hatchet in the next few months.
gRPC is fantastic, but support across runtimes isn't great. in particular, we've had a bunch of requests for serverless runtimes like @Cloudflare Workers which we haven't been able to support because of gRPC compatibility issues. the original serverless runtimes were built around the fetch() API, which is missing a bunch of http/2 features that we need.
we've been quietly waiting on gRPC support across these runtimes -- and Cloudflare just rolled it out in beta! -- but demand was high enough that we're just sending it.
The great part about ConnectRPC is that it's fully gRPC compatible, so existing clients will still work. Just a 10/10 dev experience overall: https://t.co/eK4u1YADeB
full serverless and sandbox support coming soon.
How well do you actually know Protocol Buffers? We put together a quick interactive quiz covering schema design, field rules, and wire format mechanics.
https://t.co/TghGexYZTZ
The questions are now randomly selected from a question bank so retrying will give you a few new questions.
#protobuf #grpc #quiz
Protovalidate performance has improved dramatically. 3x faster in Go, 10x faster in Java, 13x faster in TypeScript and 484x faster in Python. No, that wasn't a typo. It really is that much faster than before.
https://t.co/ui9KYwswL2
This is an older post, but Connect-Query is a library that deserves more attention. It makes it trivial to pull in data from ConnectRPC servers using Tanstack Query. It simplifies state management and makes querying for data extremely simple.
https://t.co/XSzoUhFR6z
Protobuf is already byte-efficient, but you can squeeze out even more. See how delta encoding dropped our test payload size by another 67% in our latest post:
https://t.co/xyrV9D1vGm
@lmariscal Good timing! There's some movement here. The difficult pieces needed for this to happen are almost done, so we'll be able make this happen soon.
In case you missed it, here is a roundup of the latest from the Buf blog:
- gRPC-Web Failed the Web: https://t.co/34QgLQmogg
- connect-rust joins the Connect project: https://t.co/cMeL1yKPWO
- The modern Protobuf workflow: https://t.co/R83SXCH5Iq
- Protobuf-ES just got a lot faster: https://t.co/AImKT1zA5B
- Protobuf Tip #10: Choosing the right integer type: https://t.co/OBc3oA3sR5