My Journey With Elixir and Flow-Based Programming: Allan MacGregor

Elixir Community Voices is a series of interviews with the people behind the Elixir and Erlang community. If you are an individual or a team investing in the Elixir ecosystem, I would love to hear and share your story.

My Journey With Elixir and Flow-Based Programming: Allan MacGregor

I first met Allan over a Zoom call about a week ago. I have been following his blog for some time and wanted to know more about his book draft about design patterns in Elixir. It wasn't until the call itself that I found out how many ideas we share - about the future of Elixir, its role as an alternative to present-day distributed solutions, and last but not least, its potential for the next generation of e-commerce solutions.

Who are you?

Allan: I'm a software engineer with 15 years of experience, based in Toronto, Ontario. I was born and grew up in Mexico, and over the last 11 years, I have been able to build a career and life in Canada.

Most of my professional career has been focused on e-commerce development, which I would say can be broken down into three main categories:

  • Building user-facing experiences
  • Building e-commerce engines to map the business logic
  • Integrations with third-party systems

Over ten years of e-commerce development, I had the opportunity to work with many notable brands in Canada and the US and solve many challenges in the space. I have also dabbled working with product companies in multiple capacities - from CTO to currently a Senior Engineering Manager at Humi.

In terms of technologies, I have had a chance to work with many different stacks and programming languages, notably PHP (LAMP), some Ruby on Rails, some Scala during my time at Hopper, and a bit of Elixir to tackle quick prototypes and transparent proxy for an e-commerce project.

Currently, I'm a Senior Engineering Manager at Humi, a great company in the HR and payroll space. I am also building a couple of micro-SaaS projects - the first one being SiteGuardian, intended to be a complete solution for website monitoring and security. It should be close to beta release later this month.

Siteguardian Ā· Better Site Monitoring

What brought you to Elixir?

Allan: I stumbled into Elixir in a bit of a weird way, going back to one of the problems that I mentioned on the e-commerce space ā€” integration with third-party systems like ERP, OMS, and the like, ā€” for that kind of problems, the idea of Flow-based programming made a lot of sense.

In essence, you structure your application to be a pipeline of black boxes that transform, filter, or handle the data in some way or another. Looking for implementations of this library, I landed on a library called FlowEx, which is written in Elixir. As I started diving deeper into the language, I honestly fell in love with it.

Elixir to me seems like this almost perfect mix of all the right qualities:

  • Flexibility and power
  • Low Learning curve
  • Extensibility
  • Expressiveness

If I had to pinpoint any particular quality of Elixir that caught my attention, it would be the expressiveness of the language - how much you can achieve with very little code.

What did you find most challenging when starting with the stack?

Allan: For me, the biggest challenge was adapting to a new paradigm and getting rid of the "bad" habits I picked up from working with Object-Oriented Languages. It is not the syntax that is different, but how you reason and think about the data flows in your program.

I guess the other challenging bit, which seems fairly common, was grasping the use of the Enum variable, Map, reduce, and the like. But once those things click, you are off to the races.

The other challenge that is still somewhat applicable is getting buying for the business or clients to use Elixir as a solution; however, I'm happy to see that it is gaining popularity and is being adopted by larger companies and teams.

Looking at your experience, do you find Elixir a viable option for the next generation of e-commerce solutions?

Allan: First, it is important to clarify what this next generation of e-commerce solutions looks like. We are currently in transition from the traditional catalog/search > product page > shopping cart > checkout experience; and moving into a stage where e-commerce becomes ubiquitous, for example, integrated into an Instagram post or inside content.

This kind of change will present a couple of interesting challenges, both in terms of scalability / performance and architectures. The current generation of e-commerce platforms is fairly monolithic, or in the case of some of the SaaS offerings, fairly restrictive.

I can see an interesting future for Elixir and similar technologies to be used to develop the next generation e-commerce platforms and services; this is especially applicable when talking about integrations between OMS, Inventory systems, and Product Information Management systems.

Have you built something with Elixir that you feel proud of?

Allan: Absolutely! Right now, I'm working on a small SaaS project called SiteGuardian, which aims to provide a robust solution for website site security and availability monitoring.

I chose Elixir for this project because first, I wanted to validate some architectural ideas and patterns that I'm researching for a book; and second, the Elixir stack allows me to build robust features and do so very efficiently.

To me, it is that perfect combination of development speed, robustness, and low operating costs that enables me to build a competitive micro-SaaS. Not to mention that my ability to iterate and build in this stack has been incredible compared to if was doing this in Laravel, or Ruby on Rails.

The second thing that I have in progress right now is a book on Elixir and design patterns. The idea is to explore and do a deep dive into the multiple variations of architectural and behavioral patterns that are relevant to functional programming and Elixir.

For anyone interested in the progress of the book, you can subscribe to my newsletter here: https://allanmacgregor.com/newsletter/

What would you like to share with people new to Erlang and Elixir?

Allan: For people considering using Elixir / Erlang, my word of advice is to give things time to sink in. Functional programming is likely to be a new idea and paradigm and might take a while to grok the concepts, but once you do, the time invested is going to pay off ten-fold.


References

Hi, Iā€™m Allan, this is where I write. - Allan MacGregor
Expert Software Engineer and Manager ā€¢ Writer ā€¢ Functional Programming Advocate
Siteguardian Ā· Better Site Monitoring
antonmi/flowex
Flow-Based Programming framework for Elixir. Contribute to antonmi/flowex development by creating an account on GitHub.
Flow-based Programming
Official website for flow-based programming