Good examples of CQRS / EventSourcing in functional language

1,427 views
Skip to first unread message

Jpup

unread,
May 23, 2016, 4:49:10 PM5/23/16
to DDD/CQRS
Hi All,

Just watch another of Greg's Talks - 

Event Sourcing is actually just functional code



It piqued my interest, having gone through and still working through building my first CQRS/ES implementation in Go and now I know a lot more about the topic in a non functional language now than I did a few months ago. Along this journey I have seen many mentions of functional language implementations being the most elegant solutions, I would like to look at what a good functional implementation looks like.

Does anyone have any recommendations for reference applications, videos or any other material that is worth looking at?

David Reaver

unread,
May 23, 2016, 5:17:16 PM5/23/16
to ddd...@googlegroups.com
I've been using Event sourcing in a personal project in Haskell for the past few weeks (for context, it's an algorithmic trading application). I think this paradigm fits a function language extremely well. I don't have a reference application for you, but here are a few resources I've collected:
Googling any combination of "Event sourcing", "CQRS", "funtional programming", "Haskell", etc will probably yield some great results too (basically how I found all of this). I'm not an event sourcing or CQRS expert by any means, but I do write Haskell for a living, and so far I've had some great results building and designing my project using CQRS/ES in Haskell.

I think it's unfortunate that a lot of the literature in this space is so heavily intertwined with object oriented programming and .NET, because CQRS/ES is a great fit for a functional language. (This is probably just due to statistics; more people use .NET languages than Haskell!)

I hope others respond with some more resources! I'd love to see what others have done.

- David

--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Greg Young

unread,
May 23, 2016, 6:42:24 PM5/23/16
to ddd...@googlegroups.com
Check out Jeremie's (thinkbeforecoding) F# version of simple cqrs

https://github.com/thinkbeforecoding/m-r/tree/FSharp/FsSimpleCQRS
> --
> You received this message because you are subscribed to the Google Groups
> "DDD/CQRS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dddcqrs+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Studying for the Turing test

Jpup

unread,
May 23, 2016, 7:06:13 PM5/23/16
to DDD/CQRS
Oh wow, it is very light compared to the imperative implementation. Thanks I will take some time to understand how it works.

Ruben Bartelink

unread,
May 23, 2016, 7:50:31 PM5/23/16
to DDD/CQRS
Also worth a scan:

https://github.com/thinkbeforecoding/FsUno.Prod 
https://github.com/CarstenKoenig/EventSourcing
The appendix on functional event sourcing in the IDDD Red book (not definitive but a good run across the landscape)
https://vimeo.com/109343720 (deep end-to-end experience report from Leo of Jet - long but not toys or theory)

--Ruben

Renato Cavalcanti

unread,
May 24, 2016, 3:27:11 AM5/24/16
to DDD/CQRS
For Scala, there is Fun.CQRS. 
It uses Akka and Akka Persistence as main backend. There is also a InMemoryBackend for tests and other backends implementations are possible.

Jpup

unread,
May 24, 2016, 4:12:20 AM5/24/16
to DDD/CQRS
:) Thanks

Alexey Raga

unread,
May 24, 2016, 6:01:04 AM5/24/16
to DDD/CQRS
I did a simple example of using the EventStore in Haskell implementing a canonical DDD primer (a shopping card): https://github.com/AlexeyRaga/haskell-es-example

Regards,
Alexey.

Michael Clark

unread,
Jun 14, 2016, 9:33:12 AM6/14/16
to DDD/CQRS
Lev Gorodinski (Jet.com) did an interesting port F# of the standard InventoryItem example.  It gave me a good understanding about how to utilize discriminated unions in defining Events/Commands:


He includes integration with EventStore as well

Mohsen

unread,
Dec 30, 2017, 5:08:05 AM12/30/17
to DDD/CQRS
Reply all
Reply to author
Forward
0 new messages