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
by @girlsleuth Whether you call it UI testing, End-to-End Testing, End-to-User Testing, or Acceptance Testing–it is often an intensely ...
New
axelson
ElixirConf 2017 - HTTP 2 Plug to Phoenix Cowboy too - @Gazler In this talk, we will look at the changes in C...
New
axelson
ElixirConf 2017 - Keep an Eye on the Sky with Nerves and Phoenix - @electricshaman As part of the next gener...
New
axelson
Here’s the last ElixirConf 2017 video of day one! ElixirConf 2017 - Scaling up Elixir at TpT - by @shanti I...
New
Lawrence_elixir
ElixirConf EU 2019 talk videos ElixirConf EU 2020 - Early bird tickets on sale now! Website: http://www.elixirconf.eu Twitter: www.t...
New
axelson
ElixirConf 2017 - Writing an Editor in Elixir - by @ijcd (Ian Duggan) Elixir for GUIs? Yes, it’s possible. I...
New
New
axelson
I really like the idea of discussing one Elixirconf talk each day and since @brightball hasn’t posted the second talk I’ll post it. Elix...
New
CodeSync
Code Sync: Vaxine, the Rich CRDT Database for ElixirPhoenix Apps | James Arthur | Code BEAM America 2022 Comments welcome! View the <spa...
New
axelson
Hey everyone! I hope everyone enjoyed ElixirConf! I know that I did. In order to facilitate and continue the discussion (especially since...
New

Other popular topics Top

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
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New

We're in Beta

About us Mission Statement