Practical Function Composition in Go

This article introduces a practical approach for implementing the function composition in Go. If you are too impatient to read the whole story, you can directly go to the source code


One of the most interesting features of functional programming languages is the ease of composing functions. The function composition in mathematical notation is simply an operator dot’ that takes two functions f(x) and g(x) and produces another function h(x) = (f ⋅ g)(x), defined as f applied to the result of applying g to x, or (f ⋅ g)(x) = f(g(x)).² A pipe ‘|’ operator is also a…

Building Natively Scalable Microservices

Image from


Almost anyone familiar with microservices architecture, has heard about scaling. Scaling is the process which enables load balancing by running multiple instances of a service (container).

In any of the existing orchestration platforms, scaling can be done either automatically or manually. But, both approaches require some sort of administration deciding when a microservice needs to scale. This article introduces an autonomous scaling method driven by OS system calls without the need for external interference .


Autonomy is one of the main principles of microservices architecture, and is essential for building agile ecosystems. In an agile ecosystem, along with agility in…

A Microservices Architecture Inspired By Living Beings

Red Blood Cells from


While being a devoted programmer, I like to spend my spare times on art and drawing. In fine arts, it’s known to make better figure drawings, it’s required to have at-least a slight understanding of human anatomy. This’s how I got acquainted to the body structure.

According to the anatomy textbooks, there are eleven systems in the human body. Each system cooperates with another to fulfill various task, i.e., almost every task is done by several organs not belonging to the same system. These are naturally making a super system which is able to survive on its own.

Finding these…


A while ago, I was asked to implement an Auth¹ microservice supposed to run on a low-resource machine². As I’m experienced in both Java and PHP — and obviously, talking about low resources, Java is a no-no — I decided to use PHP and Lumen (as it’s expected to be lightweight and stunningly fast³).

I started working, and not-surprisingly thanks to open-source packages, I could wrap all the things up in a couple of days. Then, I prepared the Dockerfile and the integration with CI build system. Soon after, I announced the employer that everything is ready to go. …

From an Intermediate’s Point of View

It’s not just about performance!

Recently, I more frequently hear many say “C++ is just about performance!”. Is that it? I mean. It’s great to learn a performant¹ programming language, but is it enough to prefer one language over another? Then, why not C, for example. For me, personally, C++ is more than that—so much more.

For some C++ developers, it’s somehow like being part of a cult or a religion. The matter, for many others, is that they love C++, but they cannot give a reason why. …


When two or more clients want to update the same record, a conflict may occur which is known as a race condition. To prevent such a conflict, a pessimist system assumes the worst, i.e., the updates always occur at the same time. Thus, it eliminates the race condition by locking the record. Pessimist systems typically rely on the database locking facilities; for example InnoDB’s row-level lock.

On the other hand, an optimistic system assumes that although race conditions may occur, they are very rare. …

Ali AslRousta

Passionate Developer

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