Author: Shivangi Gupta

First steps to build Spring Boot Application with Couchbase

Reading Time: 2 minutes As the name of the blog suggests, we will be taking the first steps to build a simple application from scratch using Couchbase as a database and spring -boot as a framework. Let’s get started. You can create a starter maven project using this link. Add Web, Lombok and Couchbase dependencies. The pom.xml should look like: This file contains bidirectional Unicode text that may be Continue Reading

Tuning consistency with Apache Cassandra

Reading Time: 4 minutes One of the challenges faced by distributed systems is how to keep the replicas consistent with each other. Maintaining consistency requires balancing availability and partitioning. Fortunately, Apache Cassandra lets us tune this balancing according to our needs. In this blog, we are going to see how we can tune consistency levels during reads and writes to achieve faster reads and writes. Before digging more about Continue Reading

Lagom Message Broker API Testing

Reading Time: 3 minutes Many of us have been working with Lagom, so I will skip telling about Lagom. Let’s just quickly go through the  important APIs that Lagom provides: Service API Message Broker API Pesistence API In this blog, we will see how we can test the Message Broker API provided by Lagom. But before doing that let’s just briefly see what this API provides! Lagom’s Message Broker Continue Reading

monads

Back2Basics: Exception Handling – #4

Reading Time: 3 minutes In the previous series of blogs, we have seen how we can do error handling in Scala. In this blog, we will explore yet another way of handling exceptions using the functional style of programming. Scalactic is a library which provides an “Either with attitude” named Or, designed for functional error handling. Or gives you more convenient chaining of map and flatMap calls (and for Continue Reading

monads

Back2Basics: Exception Handling – #3

Reading Time: 2 minutes In our previous blog Exception Handling – #2, we talked about how we can handle exception using Either. In this blog, we will explore further about Either, how we can elegantly handle exceptions using Either while working with Collections. We use collections when we want to perform some operations on elements. But what if something goes wrong while performing the transformation, do you have any Continue Reading

monads

Back2Basics: Exception Handling – #2

Reading Time: 3 minutes In our previous blog, we have seen how we can handle exceptions using try/catch and Try block.  In this blog, we will explore how we can handle exceptions using Either. Either, just like a Try, is also a container type which can have one value either Left or Right at a time. We can also use Option to handle exceptions but if an exception occurs returning Continue Reading

monads

Back2Basics: Exception Handling – #1

Reading Time: 3 minutes While building an application, it is common that something might go wrong. What if there is an attempt to divide a number by 0 or fetching the data from the database which does not exist, or reading a file which can’t be located? We need to handle such situations to make sure our application does not go down. Every language provides ways to handle such Continue Reading

Back2Basics: The Magic of Implicit – #2

Reading Time: 3 minutes In our previous blog, The Magic of Implicit, we have talked about how implicit values are being used. In this blog, we will explore Type Conversion with implicit and implicit classes. Let’s start with a simple example, scala> val i: Int = 2.3 <console>:11: error: type mismatch; found : Double(2.3) required: Int val i: Int = 2.3 Here we were trying to assign a double type value Continue Reading

Back2Basics: Demystifying Variance

Reading Time: 5 minutes In this blog, we will explore types of variances in Scala. In-variance Co-variance Contra-variance First, let’s talk about Types in Scala. scala> import java.util.ArrayList scala> var ref1: Any = “Hi” ref1: Any = Hi scala> var ref2: String = “Hi” ref2: String = Hi scala> ref1 = ref2 ref1: Any = Hi In the above example, ref1 is of type Any and ref2 is of Continue Reading

Back2Basics: The Magic of Implicits

Reading Time: 3 minutes Implicit System is one of Scala’s language greatest feature with the help of which we can write concise code. The implicit system in Scala allows the compiler to adjust code using a well-defined lookup mechanism. In this post, we will try to understand how Scala’s implicit work magically. Scala provides an implicit keyword that can be used in two ways: method or variable definitions, and method parameter lists. Continue Reading

Back2Basics: Type Erasure in Scala

Reading Time: 3 minutes Scala has a really strong type system. Scala’s static type system is listed as one of its strong points. But even though Scala’s type system is theoretically very strong, in practice some type-related features are weakened by the restrictions and limitations of its runtime environment, i.e. Type Erasure. So, what is type erasure? Type erasure refers to the runtime encoding of parameterized classes in Scala. Continue Reading

Git Cheat Sheet: Basics

Reading Time: 2 minutes In this blog, I have listed some of the basic commands like installing and configuring the Git. How Git works is not the focus of this post. I have piled up some commands for performing basic operations in git. 1) Install Git sudo apt-get update sudo apt-get install git 2) Configuring username and email of git git config –global user.email “shivangi.gupta@knoldus.in” git config –global user.name Continue Reading

Unveiling The Mystery Of Serverless

Reading Time: 2 minutes In this blog, we will explore about Serverless and why it is trending so much? Serverless, is itself a self-explanatory word, means there are no servers. But, is it really true? No, it is not. Serverless does not mean the absence of servers. There are servers actually, it’s just that we don’t have to manage them. All the infrastructure is provided by companies like AWS, Google, Azure Continue Reading