Photo by J W on Unsplash

It’s a day like any other one. Focused on your work, you suddenly noticed someone who had walked into the office and is standing confused. At this point, you realized that he’s probably a new developer who’s joining your team today.

As your role is to be his buddy, you decide to introduce all members and say a few words about the project, tools the team uses, and how you work. That’s all. It’s time to get back to work. There’s no time for details or baby-sitting. …


To guarantee zero downtime deployment, while deploying a new version of our application on more than one node, we can use rolling updates. What if this new version has a migration which renames either column or table? Will rolling updates protect our application against downtime?

Let’s assume that we have a users table. As the name is not clear, we have decided to rename it to participants, as we keep there records of people who signed up for a triathlon race.

Not only did we write a migration which renames table, but also changed both the module and schema…


Photo by Randy Fath on Unsplash

Imagine coming to an overcrowded fast food restaurant to order the best taco in the country and there’s only one cook working there. He prepares each taco one by one. Although the cook has an extra time while waiting until a tortilla heats up, he doesn’t start preparing another order until the first one is finished.

That’s your software without concurrency and parallelism.

But what are the differences between those two? How are they handled in Elixir? Let’s start from the beginning.

Concurrency vs parallelism

In order to better understand the difference, let’s take a closer look at the above mentioned restaurant problem.


Photo by Neil Thomas on Unsplash

Elixir is built on the top of the Erlang Virtual Machine. It allows us to write highly available systems that can run practically forever. Does that mean that we don’t have to do anything to make our systems reliable?

In our system, we have a worker which pays drivers money for their job.

Let’s take a closer look at our Payment.pay_the_driver/1 function to see what it does.

The system compares money already paid with the amount which a driver should receive. It guarantees that a driver won’t receive more than they should.

Unfortunately, developers make mistakes and there’s…


Photo by Barth Bailey on Unsplash

Elixir code used in migrations can cause troubles when we decide to start up our system with an empty database. To understand the problem, let’s take the same example as the one used in my previous article entitled “How to migrate live production data“.

Each year, triathlon races are held in many countries. Triathletes from around the world can sign up for one of 4 distances.

Notice that every time someone tries to register, we have to fetch the participant count. We also have to use a lock to prevent race conditions. …


Photo by Ricardo Gomez Angel on Unsplash

Don’t be another applicant who doesn’t stand out from the hundreds of candidates.

Show that you care

While preparing your CV and a cover letter pay attention to details.

The recruiter should see that you really want to work with them. Write something about the company and the position you apply for. Don’t send the same CV to multiple companies. Personalising your CV is the best way to stand out.

Show that it matters to you who you will work for. After all, you don’t want to find whichever job as a junior developer. …


Photo by Muukii on Unsplash

Migrating live data is risky. Let’s analyze the example below to see why.

Each year, triathlon races are held in many countries. Triathletes from around the world can sign up for one of 4 distances.

Notice that every time someone tries to register, we have to fetch the participant count. We also have to use a lock to prevent race conditions. This can be slow when many people are trying to register at the same time.

To solve that, we decide to add the entries_left field.

While signing up for a race, we can check left entries based…


Photo by Greg Rakozy on Unsplash

In our systems, most business actions require changes across multiple contexts. How can we keep these contexts consistent?

Let’s look at an example and analyze potential problems and solutions.

Imagine a logistics application, where drivers can earn money by completing jobs. We’ll focus on two modules: Documents and Payment. For every job, the system requires two documents to be uploaded and then accepted. After both documents have been accepted, a driver receives compensation for their work.

Patryk Bąk

Elixir developer at AppUnite | twitter.com/patrykbak91 | patrykbak.com

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