I have recently attended the Advanced Scala Training Course by TypeSafe during the Scala Days Conference in Amsterdam. During the course we discussed a lot on how to write cleaner and more performant Scala code: one of the parameters that can greatly influence your performance is the type of collections used. Which type of collection… Continue reading Performance Comparison between immutable Seq, List, Vector
Author: Daniela Sfregola
Pimp My Library
Methods are an efficient way of reducing code duplication and make our code cleaner. What happens if a class that you don't own (i.e.: any class of the Standard Scala Library) doesn't have a particular method that could make your life a lot easier -- and your code a lot more readable? This article will… Continue reading Pimp My Library
Loading Configurations in Scala
The separation of configuration from code is a good practice that makes our system customisable as we can load different configurations according to the environment we are running it in. In this article we will describe different approaches to load configurations in Scala and how they can be combined together: loading configurations from a file,… Continue reading Loading Configurations in Scala
Scala Italy 2015 Highlights
A few days ago I had the opportunity of attending and speaking at Scala Italy 2015, hosted in Milan. Scala Italy is the only Italian Conference on Scala: they aim to spread the use of Scala in the Italian Developers Community and to contribute to the Scala Community. The conference was hosted by UniCredit and… Continue reading Scala Italy 2015 Highlights
Akka Dead Letters Channel
Akka doesn't guarantee the delivery of a message. What happens when a message cannot be delivered? In this article we will describe how the Dead Letters Channel works and how it can be used to spot issues in our system. How it works In a previous article we have described the use of Event Streams… Continue reading Akka Dead Letters Channel
Peer-to-Many Communication in Akka
The most common communication channel in Akka is Peer-to-Peer, where an individual actor sends a message directly to another individual actor actor. However, sometimes this is not enough as we may need a Peer-to-Many type of communication, where an individual actor sends a message to a group of actors. This is particularly useful when you… Continue reading Peer-to-Many Communication in Akka
Pure Functions
One of the key principles of functional programming is writing pure functions. What is a pure functions? Why do we care? Why everyone is talking about it? This article will try and answer these questions. Purity and Referentially Transparent Expressions A pure function is composed only by referentially transparent expressions. An expression is referentially transparent… Continue reading Pure Functions
How to Compose Futures
Futures are a powerful tool that has been developed by the Akka team and then adopted as a standard Scala library from version 2.10. A Future is a placeholder for a value that will be available in the future: thanks to it, it is possible to run operations in parallel and to worry about what… Continue reading How to Compose Futures
How to Integrate ReactiveMongo in your Akka Spray Application
Scalability can be challenging when database access is needed: the common approach is to block the thread until a response is received. ReactiveMongo is a MongoDB Scala Driver that provides fully non-blocking asynchronous I/O operation that increases the scalability of your system. In a previous post we have seen how to build a REST Api… Continue reading How to Integrate ReactiveMongo in your Akka Spray Application
How to Supervise Akka Actors
Supervision is one of the core operations that an Actor can fulfill. Handling errors is not always easy in a classic object oriented programming context as exceptions can be difficult to predict as they are fully embedded in the normal execution flow. In the Akka Actor Model, errors are handled in a well-structured isolated execution… Continue reading How to Supervise Akka Actors