Reading Time: 4 mins

While writing a custom Mix task in Elixir, I ran into minor challenges for running / executing an Ecto query to update a database table column from within my mix task. It was not straightforward initially thus I thought to share here. In this short article, we will also see how to pass arguments to our mix task to run dynamic query.

First, what is Mix? Elixir documentation says:

Mix is a build tool that ships with Elixir that provides tasks for creating, compiling,...

Read complete blog post

I have been writing code in Imperative programming languages for many years. Writing code in functional programming is a big shift and change in thinking. As I recently started with Elixir and when I was reading about Functional Programming, I keep reading mention of Lambda Calculus every time. That ignited my curiosity to brush up my computer science knowledge.

As Functional programming languages implement Lambda Calculus(λ-calculus). If we understand how Lambda Calculus notation works from...

Read complete blog post

In one of our Rails 4 app, we decided to move file and image uploads to another microservice so that the load on server is reduced when a big file is uploaded. We decided to do this in Phoenix.

In Phoenix, we have ex_aws package which makes file uploads to S3 very simple just like Rails. So lets get started.

Add ex_aws

Update mix.exs to include following dependencies.

defp deps do
 {:ex_aws, "~> 1.0"},
 {:poison, "~> 2.0"},
 {:hackney, "~>...

Read complete blog post

enter image description here

Spoiler Alert: This article is not about Microservices architecture or how microservices works. In this article, I will share what we have learned in scaling one of the large SaaS platform, our ongoing improvements and how Microservices architecture is playing a key role in scaling this SaaS platform.

This SaaS Platform has experienced tremendous growth in the past 18 months. It has now become one of the leading CRMs in North America.

Everyone’s definition of “scale” and “growth” can differ...

Read complete blog post

Recently building few microservices and apps in Elixir and deploying it to heroku, we realised that heroku was not very cost effective for us and also we can't get into every nuts and bolt of how heroku manages our app. As a part of learning things related to deploying to our own server and to save some bucks we decided to look for other options and we decided to experiment deploying one of our app to Digital ocean. One thing we were worried about, was whether we can make deployment as easy...

Read complete blog post

Note: This article requires basic knowledge of elixir. If you are not familiar with I will encourage you to check the link

Ecto is a database abstraction layer for elixir. It provides a domain specific language to interacting with your database. It is also intended for relational database much like Active record. But it share more traits with LINQ in how it generate queries. Ecto in many ways different from ORMs like Active record. Unlike Active record, which uses model as a direct interface...

Read complete blog post

One of the coolest feature I came across in Elixir - our code documentation becomes our unit tests. I was amazed by its simplicity when I saw it in action in sample app I was writing. I feel this is one of the most incredibly and helpful feature I saw in any modern programming language in recent times. (Python has similar functionality using Python’s doctest.)

Let me explain this by giving a quick demo using few simple examples: Math functions sum and multiply.

Lets say this is our Maths...

Read complete blog post

Recently I was looking at various ways to create a constants in Elixir. I come from ruby background, where it is very easy to create and think of constant. You can create constant by assigning a value to constant name. Constant name should begin with capital letter in ruby. Concept of constant is bit twisted in ruby as we can reassign constant to different value.

 I_AM_CONSTANT = "though i can be reassigned :)"

Ohh! Just remembered this is a post about Elixir and not Ruby. Being in...

Read complete blog post

Web app had heavily evolved from times when web app was just meant to display some data using markup languages. There was a time when every software needed to be installed in every machine that want to use the software. Improvement in server side technologies, browsers and internet speed have fueled the phenomena of SAAS (Software As A Service). The rule of building a software has changed drastically. Most of the software that are developed today is developed by considering "use from any...

Read complete blog post

Few weeks back I was reading a blog about concurrency limitations in Ruby (which we all are aware since long) and how Elixir is evolving. Thus I was extremely curious to know this new dynamic functional programming language "Elixir", the two decades old Erlang language & Erlang Virtual Machine (VM) known for running low-latency, distributed and fault-tolerant systems. This article is a result of my curiosity about Elixir and Erlang.

This article does not cover (i.e. out of scope)...

Read complete blog post