article thumbnail

A guide to UDP in Scala with FS2

Rock the JVM

The UDP header is fixed at 8 bytes and contains a source port, destination port, the checksum used to verify packet integrity by the receiving device, and the length of the packet which equates to the sum of the payload and header. flip () println ( s "[server] I've received ${content.limit()} bytes " + s "from ${clientAddress.toString()}!

Scala 90
article thumbnail

Functional Python, Part II: Dial M for Monoid

Tweag

They allow the definition of “interfaces for types”, where values of types which conform to that specification can be freely swapped out. reading and writing to a byte stream). classmethod def decode ( cls , data : bytes ) - > Self : # Implementation goes here. traits” in Rust and “concepts” in C++20). write ( obj.

Python 83
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

article thumbnail

Postgres Aurora DB major version upgrade with minimal downtime

Lyft Engineering

Instead, we chose to use an envoy circuitbreaker , which returns an HTTP 503 code immediately to the downstream caller. This should definitely help bring down the downtime further given that all of the steps for replication, cutting the traffic over to the upgraded DB, and the rollback setup would be handled within their platform.

Bytes 78
article thumbnail

Tulip: Modernizing Meta’s data platform

Engineering at Meta

Chart 2: Bytes logged per second via Legacy versus Tulip. We can see that while the number of logging schemas remained roughly the same (or saw some organic growth), the bytes logged saw a significant decrease due to the change in serialization format. Reader (like logger) comes in two flavors , (a) code generated and (b) generic.

Bytes 104
article thumbnail

Improving Efficiency Of Goku Time Series Database at Pinterest (Part?—?1)

Pinterest Engineering

See the graph below, which shows the compaction read and write bytes on a cluster when it is bootstrapping for the first time. Figure 10: compaction read and write bytes showing non zero values as soon as host starts up. This slow bootstrap time was a definite hindrance on our move to less compute heavy instances for cost savings.

article thumbnail

A Functional Load Balancer with Scala, Http4s and Cats Effect

Rock the JVM

Using a dedicated Url type makes the code more self-explanatory and provides a clear and meaningful abstraction for URLs. Project Structure We will use Scala 3.3.0, and several monumental libraries to complete our project. val MunitVersion = "0.7.29" val LogbackVersion = "1.4.11" val MunitCatsEffectVersion = "1.0.7"

Scala 105
article thumbnail

The Big Kotlin Tutorial

Rock the JVM

By the end of this course, expect to write 300-400 lines of code. It’s a jam-packed, long-form, hands-on course where you’ll write not hundreds but thousands of lines of code from scratch in dozens of examples and exercises, including an image processing project that you can use for your own pictures. They are constants once defined.

Scala 87