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