How do you break a Monolith into Microservices at Scale? This ebook shows strategies and techniques for building scalable and resilient microservices.

This is blog entry originally written in the middle May 2014. I also seem to writing this code every 3 months or so and then I forgot. So I need a trigger to remember exactly how to work Scala Maps and sort the entries by key.

Let’s break out the Scala REPL.

Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_51).
Type in expressions to have them evaluated.
Type :help for more information.

We will create a map of collection of String associated with Integer elements. This data might have come a key value storage or you may have a similar requirement to work with statistical data.

Here is another tip. Let’s say you need to create a histogram of 100 different product items. You can create this data structure immutable at the beginning. However, as you are building the statistic, you may prefer to use an mutable collection map instead.