axelson

axelson

Scenic Core Team

15) ElixirConf 2017 - Perhap: Applying Domain Driven Design and Reactive Architectures to Functional Programming - Rob Martin

ElixirConf 2017 - Perhap: Applying Domain Driven Design and Reactive Architectures to Functional Programming - by @Version2beta

Perhap is a framework for building reactive applications in a Domain Driven Design (DDD) context, which makes it both opinionated in how you design your system, and highly efficient in how you implement it.

  • As an event store, Perhap receives events, persists them to Riak, Cassandra, or DynamoDB, and delivers them to consumers over HTTP or a message bus.
  • As a DDD application framework, Perhap extends that event store to route events to registered domain services implemented as pure functions (reducers), receive back domain models, and answer queries about entities or allow clients to subscribe to changes in an entity model.

Between these two use cases, Perhap provides a foundation for application development that focuses our attention on domain modeling and our development efforts on the front end and business logic only. We use the core concepts from Domain Driven Design to model our bounded context, entities, events, and models, all enforced by the framework. We get the benefits of a fully reactive architecture for free. Perhap fits extremely well with the Redux store, event, action pattern, or with the Elm model, update, view, subscribe architecture.

This talk focuses on why and how we’ve used Domain Driven Design to improve our design and architecture in a functional programming environment (specifically using Elixir), how the Reactive Manifesto influenced our choices, and how the product of that work, Perhap, can be used to quickly develop applications using those patterns. We’ll walk through a simple application built on Perhap.

As of May 28th, we’ve built three versions of Perhap - two proofs of concept, and an implementation as a production app that doesn’t break a sweat supporting 17,000 users generating a hundred thousand events a day for a Fortune 250 sportswear giant. The open source refactor is not production ready, but will be either ready or close to ready by ElixirConf.

Audience: Beginner-Intermediate

Links/References

All talks are available in the Elixir Conf 2017 Talks List or via the elixirconf2017 tag

Most Liked

JEG2

JEG2

Author of Designing Elixir Systems with OTP

Two thoughts:

  1. I love DDD talks
  2. I always wish DDD talks wouldn’t explain DDD via some libraries
Version2beta

Version2beta

I think Domain Modeling Made Functional does a good job of using F# for examples, but describing a functional approach to applying domain driven design. He describes DDD well, and then lays out a process, somewhat generically first and then implemented in code.

I reviewed Perhap with Scott a few weeks before this presentation and his feedback was generally positive in using Perhap according to the techniques he describes in the book.

lessless

lessless

How applicable is “Domain Modeling Made Functional”? I have a Functional and Reactive Domain Modeling from Manning and author relies heavily on a ADT to model domain data and except that almost nothing interesting for the Elixir developer there - all the same stuff that one will do normally: function composition and using OTP.

So the Elixir developer that book is half non-applicable, half trivial. I would say that biggest take away was from non-technical chapters :slight_smile:

Looking at the “Domain Modeling Made Functional” ToC I have a feeling that it’s can be the same situation with it.

Where Next?

Popular in Talks Top

axelson
Let’s Talk Process Dictionary - @gregvaughn Well, the first rule of Fight Club, I mean: process dictionary is that we don’...
New
CodeSync
Hologram Building Rich UIs with Elixir Running in the Browser - Bart Blast | ElixirConf EU 2025 Comments welcome! View th...
New
axelson
ElixirConf 2017 - Dr. Erlang/OTP or: How I Learned to Stop Worrying and Love :disk_log - Eric Entin Even aft...
New
AstonJ
Kicking this thread of with the now infamous talk by Dave Thomas (or at least the best recording of it I can find) - please add any you f...
New
axelson
ElixirConf US 2018 – Architecting Flow in Elixir - From Leveraging Pipes to Designing Token APIs – René Föhring (@rrrene) ...
New
ElixirConf
ElixirConf: ElixirConf 2023 - Tim Gremore - Replacing React: How Liveview solved our performance problems Comments welcome! View the <sp...
New
Lawrence_elixir
@keathley - Senior Engineer Bleacher Report and Elixir Outlaws presenter Talk: Building Resilient Systems with Stacking Talk in three w...
New
ElixirConf
ElixirConf: ElixirConf 2023 - German Velasco - Using DDD concepts to create better Phoenix Contexts Comments welcome! View the <span cla...
New
AstonJ
Keywords: LiveView autocomplete, LiveView search, focus Startups and web developers take note. Phoenix LiveView is the revolutionary fr...
New
brightball
Since the comments are turned off on the YouTube videos, I’m going to post on talk per day on here for viewing and discussion…starting wi...
New

Other popular topics Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement