# Twirp

Twirp is a simple RPC framework powered by Protocol Buffers.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Announcing Twinagle: Twirp and Protobuf for Finagle

DevFeed: [Announcing Twinagle: Twirp and Protobuf for Finagle](<https://devfeed.tech/articles/announcing-twinagle-twirp-and-protobuf-for-finagle-1988.md>)

Original publisher: [Read original article](<https://developers.soundcloud.com/blog//announcing-twinagle>)

Published: 2020-06-12T00:00:00Z

Content type: release

Language: en

Sources: [SoundCloud Backstage](<https://devfeed.tech/sources/soundcloud-backstage-blog.md>)

Topics: [Twirp](<https://devfeed.tech/topics/twirp.md>), [Serialization protocols](<https://devfeed.tech/topics/serialization-protocols.md>), [Data serialization](<https://devfeed.tech/topics/data-serialization.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>)

Tags: [about](<https://devfeed.tech/tags/about.md>), [addition](<https://devfeed.tech/tags/addition.md>), [all](<https://devfeed.tech/tags/all.md>), [allows](<https://devfeed.tech/tags/allows.md>), [also](<https://devfeed.tech/tags/also.md>), [alternatives](<https://devfeed.tech/tags/alternatives.md>), [announce](<https://devfeed.tech/tags/announce.md>), [announcements](<https://devfeed.tech/tags/announcements.md>), [api](<https://devfeed.tech/tags/api.md>), [api-development](<https://devfeed.tech/tags/api-development.md>), [app](<https://devfeed.tech/tags/app.md>), [blog](<https://devfeed.tech/tags/blog.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [finagle](<https://devfeed.tech/tags/finagle.md>), [json](<https://devfeed.tech/tags/json.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [post](<https://devfeed.tech/tags/post.md>), [protobuf](<https://devfeed.tech/tags/protobuf.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [scala](<https://devfeed.tech/tags/scala.md>), [serialization](<https://devfeed.tech/tags/serialization.md>), [this](<https://devfeed.tech/tags/this.md>), [twirp](<https://devfeed.tech/tags/twirp.md>), [with](<https://devfeed.tech/tags/with.md>)

### AI overview

Twinagle is SoundCloud's open source implementation of the Twirp protocol for Scala/Finagle. Twirp uses protobuf interface definitions to generate service interfaces, clients, and server code; requests are HTTP POSTs with JSON or binary protobuf bodies. Twinagle pairs an SBT code-generation plugin with a Finagle runtime. SoundCloud migrated its track authorization service by adding a new endpoint and thin serialization layers that preserved existing business logic, then comparing duplicate REST and Twirp responses before gradually switching traffic. The rollout reached 100% without outages or bugs. Binary protobuf reduced bandwidth between the services by more than 40%; latency improved only marginally at the 90th percentile, with no reported gains at the 50th or 99th percentiles, likely because database access dominated response time. The migration also exposed unused response fields and removed custom JSON serialization code. The article says SoundCloud was converting older services and using Twinagle for new ones.

### Source excerpt

A previous post on this blog ended with the following paragraph: "We might also replace JSON with a more efficient serialization protocol...

## Twirp: An RPC Framework for Go Focused on Simplicity

DevFeed: [Twirp: An RPC Framework for Go Focused on Simplicity](<https://devfeed.tech/articles/twirp-a-sweet-new-rpc-framework-for-go-20455.md>)

Original publisher: [Read original article](<https://medium.com/twitch-news/twirp-a-sweet-new-rpc-framework-for-go-5f2febbf35f?source=rss----3ae745429979--engineering>)

Author: Spencer Nelson

Published: 2018-01-16T20:19:57Z

Content type: release

Language: en

Sources: [Twitch](<https://devfeed.tech/sources/twitch.md>)

Topics: [Twirp](<https://devfeed.tech/topics/twirp.md>), [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Back end](<https://devfeed.tech/topics/backend.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [developer](<https://devfeed.tech/tags/developer.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [go](<https://devfeed.tech/tags/go.md>), [golang](<https://devfeed.tech/tags/golang.md>), [http](<https://devfeed.tech/tags/http.md>), [new-features](<https://devfeed.tech/tags/new-features.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [rpc](<https://devfeed.tech/tags/rpc.md>), [twirp](<https://devfeed.tech/tags/twirp.md>), [twitch](<https://devfeed.tech/tags/twitch.md>)

### AI overview

Twitch releases Twirp, an open-source RPC framework for communication between backend servers written in Go. It uses structured RPCs over HTTP 1.1 and emphasizes simplicity, stability, and modularity compared with REST APIs and gRPC.

### Source excerpt

Twirp is a new RPC framework available under an Apache 2 open source license. Today Twitch is releasing an RPC framework we use for communication between backend servers written in Go. It's called Twirp, and it's available now under an Apache 2 open source license. Twirp has been tremendously successful at Twitch -- it has grown in usage exponentially, roughly tripling every three months as more and more internal teams continue to adopt it due to its advantages over "REST" APIs or gRPC, its two closest competitors. Structured RPCs are much easier to design and maintain than URL-oriented REST APIs, as they let you focus on business logic instead of routing schemes. Changing APIs to add new fields or methods is much easier and the peculiarities of serialization (like, say, JSON's lack of 64-bit numbers) can be hidden from view. gRPC implements structured RPCs but we found that its complexity and sprawl brought an unacceptable number of bugs -- and we had trouble justifying its hard http/2 requirement. Twirp is a structured RPC framework, but with an emphasis on simplicity. It works on HTTP 1.1, chooses stability and modularity over an expansive feature set, and then gets out of the way. Twirp is so simple, in fact, that you can make valid requests on the command line with cURL without much thought. It's as simple as a Content-Type header, a proper payload, and the right URL -- all of which are very well-standardized. So, for example: # This is a valid Twirp request: curl \ -header 'Content-Type:application/json' \ -data '{"user": "spencer", "email": "spencer@twitch.tv"}' \ http://localhost:9090/twirp/twitch.example.EmailBoss/UpdateEmail We think you'll want to use Twirp if you're working in a service-oriented architecture and program mostly in Go. We also think you'll be able to drop it into your system one service at a time, even if you're using several non-Go languages. The core design of Twirp is language-agnostic and we're planning to expand into new languages, but o