OTP as the core of your application

Click for: original source

In this two part series, we’ll be taking a deep dive into what exactly the Actor Model is, how exactly the Actor Model is implemented in Elixir/Erlang and how we can leverage this pattern in pragmatic way from within our applications. By Alex Koutmos.

To really understand these concepts, we will be writing a Phoenix application that relies on GenServers as the primary datasource that powers our business logic.

The article then reads about:

  • What is the Actor Model?
  • How does the Actor Model work on the BEAM?
  • Create a new Phoenix project and install dependencies
  • Writing a data scraper using Floki
  • Seeding our database with sample data

The Actor Model is a programming model that aims to provide a mechanism for dealing with and reasoning about concurrent programs. There are many paradigms and methodologies that exist to provide a pattern for concurrent programming and the Actor Model is just one of those. There are other concurrency models like CSP (Communicating Sequential Processes) and shared memory concurrency (using threads and locks). Plenty of code examples and great number of links to further reading. Good job!

[Read More]

Tags software-architecture performance frameworks elixir web-development functional-programming