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

kokolegorille
Lonestar Elixir 2018 videos are starting to pop up :slight_smile: https://www.youtube.com/channel/UCOy-_b9bqjokoWX9Hg5ZgUg Day 1 Chris ...
New
ShalokShalom
So, there is another Erlang VM on the way :hugs:
New
AstonJ
File uploads are an essential part of many web applications, but often handling them can be tricky, which explains why they are one of th...
New
ElixirConf
ElixirConf: ElixirConf 2023 - German Velasco - Using DDD concepts to create better Phoenix Contexts Comments welcome! View the <span cla...
New
axelson
by @zacky1972 Finally, we’ve succeeded in the implementation of Hastega!!! (Maybe until ElixirConf US 2019 :slight_smile: Hastega (Hyp...
New
axelson
ElixirConf 2017 - Embedded Elixir for Monitoring the Built Environment - Christopher Coté At CRT Labs (Natio...
New
CodeSync
Code Sync: Vaxine, the Rich CRDT Database for ElixirPhoenix Apps | James Arthur | Code BEAM America 2022 Comments welcome! View the #cod...
New
JuanjoA
Hi, I don’t know if I have the post in the right place. I put here in case you might be interested, I am not the author, I just found it...
New
AstonJ
Just starting to go up - did you attend? Have any faves? Here are the keynotes:
New
axelson
Posting a little bit late today but here you go: ElixirConf 2017 - Elixir + Neo4j - Regina Imhoff Neo4j is ...
New

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
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
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement