Divide and conquer has been a core strategy in software engineering. We decompose our systems into smaller modules with focused, simple functionalities and compose them back to provide richer features. In a complex modular system, developers regularly have to dedicate a significant portion of code and effort to such composition.

Needless to say, it provides fundamental benefits to be able to compose and decompose computation with ease. This is where Functional Programming (referred to as FP) mainly focuses on. For developers who wonder what difference FP makes, this blog post aims to give a taste of how it enables more…

For lack of a better term, traffic oversaturation is when the incoming traffic exceeds the capacity of the service. During traffic oversaturation, all the excessive traffic will have to wait in some queues in the service. The latencies quickly grow to the point where no requests get served within the acceptable time frame. Worse, if the incoming traffic doesn’t significantly slow down due to the high latency, e.g. when the users keep retrying regardless of the failed requests, the service will probably experience out-of-memory melt-down further down the line.

I categorize traffic oversaturation into two types based on their causes…

The concept of conceivability (being conceivable or not) has been used in many philosophical discussions. It is common to associate some notion of absolute truthiness with conceivability. One example is to tie necessarily true to conceivability - a statement is necessarily true if and only if it’s true in every conceivable world (including our own world which is obviously conceivable). …

Recently at iHeartRadio we decided to migrate our one monolithic Java backend service into multiple microservices, more specifically we decided to implement these microservices as Akka apps and use Akka cluster to weave them into our microservice cluster. This post is about how we reached this decision. There are three main sections in this post: first a brief discussion of the goals we wanted to achieve with microservices, second, the specific reasons why we think Akka apps without Http interface makes the most sense for our goals, and third, a brief look at the initial architecture design.

Goals we want to achieve

Goal 1, Easier…

iHeart/play-swagger is a Swagger spec generator for REST APIs built with Play Framework. It generates swagger specs from play route files and case class reflections without the need for any code annotation.

The main principles we follow when designing this library are:

  1. No code pollution (e.g. annotation)
  2. DRY (extract as much information from the code as possible)
  3. When documenting an endpoint, it should be just swagger specification that you need to write. You shall not need to learn another API or spec format.

Which translate to following features we implemented:

  1. Write your swagger specification in your routes files as comments…

Announcing a new iHeartRadio open source project Kanaloa. Kanaloa is a set of work dispatchers implemented using Akka actors. These dispatchers sit in front of your service and dispatch received work to them. They make your service more resilient through the following means:

  1. Auto scaling — it dynamically figures out the optimal number of concurrent requests your service can handle, and make sure that at any given time your service handles no more than that number of concurrent requests. This algorithm was also ported and contributed to Akka as Optimal Size Exploring Resizer (although with some caveats).
  2. Back pressure control

Kailuo Wang

Open Source Software enthusiast, Functional Programming advocate, maintains Cats, kittens among other OSS libraries.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store