Life Beyond Relational Database - Event Sourcing in Haskell
@abailly on twitter
arnaud@igitur.io
“You don’t need static type checking if you have 100% unit test coverage.”
“Uncle Bob” Martin - May 2016 http://blog.cleancoder.com/uncle-bob/2016/05/01/TypeWars.html
“You don’t need static type checking if you have 100% unit test coverage.”
“Uncle Bob” Martin - May 2016 http://blog.cleancoder.com/uncle-bob/2016/05/01/TypeWars.html
WAT?
- Thanks to nCrafts team for giving me space and time to talk about things I love amongst so many people I admire
- Thanks to nCrafts team for giving me space and time to talk about things I love amongst so many people I admire
- This draws on the past 2 years’ experience developing a peer-to-peer platform at Capital Match based on those techniques (see http://www.capital-match.com)
- Thanks to nCrafts team for giving me space and time to talk about things I love amongst so many people I admire
- This draws on the past 2 years’ experience developing a peer-to-peer platform at Capital Match based on those techniques (see http://www.capital-match.com)
- I assume knowledge of TDD, DDD and Event Sourcing terminology
- Thanks to nCrafts team for giving me space and time to talk about things I love amongst so many people I admire
- This draws on the past 2 years’ experience developing a peer-to-peer platform at Capital Match based on those techniques (see http://www.capital-match.com)
- I assume knowledge of TDD, DDD and Event Sourcing
- This is pretty much a permanent work-in-progress
- Thanks to nCrafts team for giving me space and time to talk about things I love amongst so many people I admire
- This draws on the past 2 years’ experience developing a peer-to-peer platform at Capital Match based on those techniques (see http://www.capital-match.com)
- I assume knowledge of TDD, DDD and Event Sourcing
- This is pretty much a permanent work-in-progress
Feedback welcomed
To share experience on implementing a real-world system using only purely functional tools and techniques
To share experience on implementing a real-world system using only purely functional tools and techniques
To offer some evidence strongly typed functional programs are a perfect fit for modern software design techniques
To share experience on implementing a real-world system using only purely functional tools and techniques
To offer some evidence strongly typed functional programs are a perfect fit for modern software design techniques
To further personal plans towards worldwide Haskell and Emacs domination
To share experience on implementing a real-world system using only purely functional tools and techniques
To offer some evidence strongly typed functional programs are a perfect fit for modern software design techniques
To further personal plans towards worldwide Haskell and Emacs domination
To have some fun
- (lot of) Strongly Typed Haskell Code Inside
- (lot of) Strongly Typed Haskell Code Inside
- Not sure how much is understandable or even meaningful…
- (lot of) Strongly Typed Haskell Code Inside
- Not sure how much is understandable or even meaningful…
- Or this might be so obvious as not being worthy of notice…
- (lot of) Strongly Typed Haskell Code Inside
- Not sure how much is understandable or even meaningful…
- Or this might be so obvious as not being worthy of notice…
Feedback welcomed
- A counter service:
- Initial value is 0
- Can
increment
counter with a positive value - Can
decrement
counter with a positive value - Can query state of the counter
- Counter’s value can not go below 0 or above 100
- TDD w/ Property Based Testing
- Purely functional model event sourced model
- Services defined from composable effectful building blocks
- Statically typed REST API w/ Servant (http://haskell-servant.github.io/)
- Use the REPL, Luke!
- Divide quod impera
- Divide quod impera
- Domain-focused language(s) -> aka. Ubiquitous language
- Divide quod impera
- Domain-focused language(s) -> aka. Ubiquitous language
- Bounded contexts -> Small self-contained domain-centric services
- Divide quod impera
- Domain-focused language(s) -> aka. Ubiquitous language
- Bounded contexts -> Small self-contained domain-centric services
- Hexagonal architecture -> Side-effects free business domain model composed within effectful context
- Divide quod impera
- Domain-focused language(s) -> aka. Ubiquitous language
- Bounded contexts -> Small self-contained domain-centric services
- Hexagonal architecture -> Side-effects free business domain model composed within effectful context
- Event Sourcing -> Immutable stream of events as the state of the system
- It’s easy to define languages and pure models and to play with them
- It’s easy to define languages and pure models and to play with them
- Strong typing helps enforcing guarantees at all levels
- It’s easy to define languages and pure models and to play with them
- Strong typing helps enforcing guarantees at all levels
- It’s easy to test drive model with properties
- It’s easy to define languages and pure models and to play with them
- Strong typing helps enforcing guarantees at all levels
- It’s easy to test drive model with properties
- Sophisticated type features makes it possible to define and compose DSL fragments
- http://okmij.org/ftp/Haskell/extensible/exteff.pdf: Extensible effects theory and practice in Haskell
- https://github.com/atnos-org/eff-cats: Same in Scala
- http://www.cse.chalmers.se/~rjmh/Papers/QuickCheckST.ps: Testing monadic code w/ QuickCheck
- http://abailly.github.io/posts/cm-arch-design.html: (Shameless plug) Blog post about the architecture implemented at Capital Match
- https://github.com/abailly/hevents: (Shameless plug bis) Work-in-progress Haskell library to simplify developing event sourced systems
- http://shaffner.us/cs/papers/tarpit.pdf: Original “Out of the Tar Pit” paper