Categories
Resources

Event sourcing and CQRS resources

Event Sourcing and CQRS resources

Articles

This page from the Lagom Documentation explains why Event sourcing is useful. Advantages of Event Sourcing

Exploring CQRS and Event Sourcing This link is from a Microsoft project and is an excellent resource about CQRS and Event Sourcing. It walks you through the entire decision process of breaking down an entire application domain with basic Domain Driven Design concepts. It is very thorough and a great read to help you understand what goes into CQRS, Event sourcing and breaking your domain into smaller more useable chunks.

CQRS increases consistency.  This article is another good short argument for why you should use CQRS.

CQRS Documents by Greg Young

CQRS Clarified by Udi Dahan

Message brokers vs Message buses These two sound the same but are different this article covers the minor details.

What do you mean by “Event-Driven”. This is an excellent article by Martin Fowler which covers Event driven systems in more detail.

Event Sourcing and CQRS with AKKA 2.6 video. This page has a video, but it also has some really useful links below the video which is why  I included it as a link.

How to use CQRS with Akka 2.6 video. This page has a video like the one above with useful links.
Using Akka and Scala for CQRS and Event Sourcing – great in depth article about Event sourcing

Books

Patterns, Principles and Practices of Domain-Driven Design by Scott Millett and Nick Tune This book covers Event Sourcing and CQRS as well as all of the other principles of Domain Driven Design. The nice thing about this book is it has code examples, the code is C#, but you don’t have to down load it to view it and basically follow along. The examples often come after long explanations of the concepts, if you have time or know C# you can download and try the example code, a nice extra if you ask me.  This is one that stays in a pile next to my desk.

Designing Event-Driven systems. This is a free ebook so what does it hurt to read it?

Distributed Data for Microservices — Event Sourcing vs. Change Data Capture

Videos

Greg Young – CQRS and Event Sourcing – Code on the Beach 2014

Greg tells some great stories that relate to why CQRS and Event Sourcing are useful and gives interesting insights into use cases. For many of us who have been doing the old fashioned CRUD architecture of storing and reading everything from a database, this video will make sense of why that was a bad way of doing things. After this video you will really want to dig into CQRS and Event Sourcing in depth.


CQRS and Event Sourcing with Lagom by Miel Donkers


An Introduction to CQRS and Event Sourcing Patterns – Mathew McLoughlin

In this video Mathew explains how an Event Sourced system that utilizes CQRS works. One thing covered is why having separate read and write data stores is a good idea and how it works in an abstracted way.


Event Sourcing You are doing it wrong by David Schmitz

I like this video this guy is funny. David quickly covers Microservices, event sourcing and other Domain Driven Design concepts, tying things together in a very entertaining animated and funny way. This is one of my favorite videos about event sourcing, it answers a lot of questions and makes many good points. This video is worth watching more than once.


Allard Buijze – Talk Session: The Inconveniences of Event Sourcing

This video has some good abstract information about events and event sourcing in microservices. It points out some of the issues with event sourcing and how to overcome them. Allard covers the types of Events, commands, events, queries and how they are used in an event driven system. The most interesting and for me useful part of this video is the part about GDPR and how to comply in an Event Sourced system at about the 38:00 mark.


Martin Kleppmann — Event Sourcing and Stream Processing at Scale


Udi Dahan – If (domain logic) then CQRS, or Saga?

Udi tells a story that builds up to CQRS and Sagas. He says in CQRS that Commands can’t be allowed to fail. At about 27:00 he explains what this means. At ~31:00 he talks about eventual consistency and how to deal with it in a system. At about 40:00 give them the Rick Sanchez slow  ramp. LOL He finishes up by talking about bounded contexts.

Categories
Resources

Scala resources

Scala links

Here are some Scala resources I have found helpful.  I’ll be adding to the list as time goes on. I have books I have not had time to read which I will list later, I’ll also list new resources as I find useful ones. This serves mostly as a collection of notes so that I can remember what I read and where I read it so I can find it again later.

The number one place to start learning Scala is the new Scala book   written by Alvin Alexander. Alvin does an excellent job of explaining Scala concepts.  The Scala tour should link to the related parts of that book.

Here is a link to the Scala Api, these are the classes that make up the language. This is the best place to get a peak under the hood of Scala and find all of the methods of a Class or a Traits signature. You will see there are links to the Library API, the Compiler API and the reflection API.

allaboutscala.com This is an excellent website with tons of tutorials and information about Scala.

Scala Glossary of Terms. Here are many of the terms you will encounter when using Scala or reading about it.

All about Dependency injection in Scala.

Here is more information about dependency injection in Scala.

Simple Dependency injection in Scala without special frameworks.

Functional programming approaches to dependency injection.

Here is another article about functional programming and dependency injection with links to more information.

More about dependency injection and Functional programming vs OOP. How to Trick OO Programmers into Loving Functional Programming

Scala is full of lots of magic, magic that can make it hard to learn because you see things done in so many ways in so many places with often little to no explanation . 4 Fun and Useful Things to Know about Scala’s apply() functions   So much of what you will read assumes you know Scala inside and out and upside down, like the Lagom documentation here where it states “As you can see, the sayHello method is implemented using the apply factory method on ServiceCall” Which you look and look and there is not an apply factory method to be seen anywhere, so you have to stop and do some google work to figure out what is going on. This little line of magic is what the documentation means ”

 ServiceCall { name =>
    Future.successful(s"Hello $name!")

It is assumed that you know that in Scala anonymous functions always contain a hidden apply method etc. like the bottom of the linked article mentions.  The main learning curve to Scala is all of the 10001+ things you have to remember about everything everywhere, my brain just does not like to memorize everything about everything, it likes to solve really hard problems.

 

New Dotty Scala 3 indentation link

Scala Books

Programming in Scala 3rd edition.  By Odersky, Spoon and Venners these are the authors of the programming language so this is one of the more in depth books of about 800+ pages and covers all parts of Scala.  This is a good book and basically a must have reference you will want to look back at from time to time. It has many small examples that can be run in the command line. You can also create scripts and call them from the command line, which is how I did the larger examples instead of typing in all of the code.  This is an older book but it is still 100% relevant in case you are wondering.

Programming in Scala 2nd edition Wampler & Payne. This is another good book that covers Scala slightly differently than the Programming in Scala by Odersky, Spoon and Venners.  This book covers Object Oriented programming in Scala as well as Functional programming. The book is almost 550 pages long, not too large or small. It also covers the type system fairly well. I like it’s discussion of implicits, these can be confusing if you come from other languages.  This is also an older book but it is still 100% relevant.  This is one of my more favorite books.

Scala Cookbook by Alvin Alexander. I feel this book is one of the Scala must haves, this book lives on my desk.  Alvin has an amazing ability to explain complex subjects in simple terms that every day developers can understand.  This book is almost 700 pages long, it is older too, from 2013 but it is also 100% relevant. This book is so wonderful because it shows hundreds of ways to do things in Scala. This is a wonderful book to have while learning and long after you have learned Scala. Many times while learning a new language you will ask yourself of others “how do you do this in this language”, this book has all of those types of answers.  This book shows how to do so much and is full of so much useful information, this is one of the must haves.

Functional Programming Simplified by Alvin Alexander. This is a wonderful book of 800+ pages that tells a story about the pieces of functional programming, breaking down the subject into over 100 small 1 to 5 page chapters. If you want to understand functional programming in Scala this is the best place to start. Even though the book is over 800 pages, the short chapters along with the authors unique ability to express complex ideas in simple terms made this programming book fun to read.  I found that the small chapters were perfect for when I only had a few minutes to read. I honestly wish more books were written in this fashion.

Functional and Reactive Domain Modeling by Debasish Ghosh. This is another good book about functional programming in Scala.  At under 300 pages it is concise and to the point.  This book cover Scalaz and almost makes you want to use it just from reading about it.  It is best to read this book after the Alvin Alexander functional programming book, this book is more advanced.  In this book the author covers why you would want to use a functional paradigm and makes a strong persuasive argument for it.  Overall I really liked this book and it is a good addition to any serious Scala programmers library.

Video

Scala best practices I wish someone’d told me about – Nicolas Rinaudo

I wish this video had been around when I first started learning Scala it answers a lot of the questions I had at first. This is one of the best videos about Scala, so much useful information here.
Nicolas gets right to it in this video

  1. Array Comparison ~2:00
  2. Type Annotation ~3:55
  3. Unicode operators ~5:30
  4. Enumerations ~7:20
  5. Sealed Traits ~8:45
  6. ADT Algebraic Data Types ~12:20
  7. Case Classes ~15:50
  8. Custom Extractors ~18:45
  9. Structural types ~20:55
  10. Exceptions ~24:05
  11. Errors ~29:50
  12. The return Keyword ~31:45
  13. Implicit conversions ~33:55
  14. Implicit resolution ~36:30
  15. String concatenation ~39:45


Scala: Beyond the basics with Christopher Batey

This is an excellent video, this will clarify quite a few things for new comers to Scala.

This video covers how to rely on the compile more and libraries less. At about 3:30 he hits on what I noticed. I have learned like 7 different languages and thought I would just learn Scala. Well Scala is so much different it is like learning to program all over again. With the OOP and the Functional capabilities along with no sort of suggested best way to do things, it makes the beginners head roll, especially when you then discover there are multiple ways to do things. Even after you learn Scala for a while you have more options and more things you can do, so you have to come up with your own rules and make sure you and your teams stick to them.

The first 11 minutes of the video discuss expression vs statement based programming. At 11 minutes Christopher starts talking about Function composition which is the main concept of this video. This video is an excellent introduction to what functional programing really is. Type Aliases covered at 12:00 mark, I googled for a while trying to figure this out when I saw it, I got very little luck. The shenanigans of learning Scala is what inspired this website. Traits are discussed at ~12:30. At about 15:00 Christopher talks about repositories using traits. Traits are used for many things in Scala.

At about 16:00 the talk about functional programming begins.

  1. ~18:00 Curried functions are explained
  2. ~20:00 Function Composition explained
  3. ~23:15 Currying and Partial function application
  4. ~25:00  Scala Class use cases
  5. ~26:30  Implicits
  6. ~28:15 Higher Kinded Types
  7. ~39:15 Implicits conversion
  8. ~45:30 He gets to how it is harder to learn Scala than other common languages. Scala is a really different kind of language. I like it most for it’s conciseness. But learning it requires learning many programming related concepts you don’t normally learn or think about. Scala requires that you and your team have MUCH MORE DISCIPLINE and you have to force yourself to stick to a paradigm or else you will get a mess.

An excellent book that covers the subject of Functional programming and function composition is Functional and Reactive Domain Modeling by Debasish Ghosh  The book is well written with clear language in less than 300 pages it is all about Functional Scala with code examples. The book covers many subjects, it is one of the books I keep in a stack next to my desk. Check the table of contents of Amazon.

Categories
Resources Web Development

Web Development resources

Media queries you should know about

Browser support for Javascript API’s – This is a very useful table to see what is supported at the moment

Link to ecmascript feature tables to look up what you can use in Javascript in current browsers.

Transaction patterns for web applications – interesting article with good information.

Must-Have Social Meta Tags for Twitter, Google, Facebook, & More 

opendyslexic Font for dyslexic people or anyone in general a good font.

andika nice clear fonts for clean looking text that is easy to read

What You Need to Know About Open Graph Meta Tags for Total Facebook and Twitter Mastery– Very good introduction to the topic, not a long read.

List of all mime types