Migrating Secrets Using HashiCorp Vault and Safe CLI

Vault and Safe

Vault is a secret management service by HashiCorp. It is a tool that will help you in storing secrets (API keys, passwords, etc.) and accessing them securely. You can use Vault with a user interface as well as through CLI. 

In this post, we will not be going deep into what Vault is, but instead, will look at how we can migrate secrets from one Vault to another. We can migrate secrets from Vault using Vault CLI, but it can get a little complicated to do so. Therefore, to make things easy, we will use Safe CLI, which is a wrapper around Vault. It will help us in managing and migrating our secrets by using simple commands. It also helps us connect to different vault instances very quickly for migration purposes.

Circuit Breaker Pattern With Netflix-Hystrix: Java

If you are familiar with the circuit breaker pattern then you may have heard about Netflix-hystrix. But, before diving into our topic, let's make sure we have an understanding of what circuit breaker is and how Netflix-hystrix is implementing this pattern.

What Problem Are We Trying to Solve?

When in a distributed environment, our service may interact with other services or applications via remote call and these external services may be unavailable anytime for several reasons such as downtime, unavailable resources, etc. This unavailability due to the fault in an external application will also affect our perfectly working application. 

Multithreading in Java

Every programmer comes across Multithreading and for some reason, it has been considered hard to understand. Well, it's not. In this blog, we will go through some basics of multithreading and in the process will try to understand why it is such an important topic in software development.

A program can have multiple processes and Multithreading allows us to run these multiple processing units concurrently. Our programs by default run on a Single thread also known as the main thread. Multithreading is useful because:

Singleton Design Pattern

Design patterns are important as they help us solve general problems with software that people face during development. These patterns help us make code maintainable, extensible, and loosely coupled. One such design pattern is the Singleton Design pattern.

In simple terms, Singleton is a class that allows us only to create a single instance of it. It makes it impossible for us to instantiate the class for the second time.

MongoDB With Spring Boot: A Simple CRUD

MongoDB is an open-source non relational, document oriented database. MongoDB being document oriented means that it stores data in JSON like documents which makes it more powerful and expressive. MongoDB’s ability to scale up and down very easily is considered to be one of its advantages over its competitors. Data is stored in documents in key pair values. Another component of MongoDB is collection, which is the simple collection of documents. Collection corresponds to Table in relational databases. In this blog we are going to explore this database with Java Spring Boot. We will create a simple CRUD API to interact with our Mongo database.

Why Use MongoDB?

  1. It is document based and therefore it is more flexible where each document can have varying fields which can not be done in relational databases.
  2. It allows us to index any field in the document to improve search results.
  3. It provides us with rich and powerful query language which allows us to filter and sort using any field no matter how nested the field is.
  4. It provides us with high scalability (sharding) and high availability (replication) of data.

MongoDB With Java Spring Boot

Assuming that you have a basic understanding of MongoDB now we will now see how we can leverage MongoDB by building a small spring boot API to perform basic CRUD operations.

Spring Custom Validations

While building applications and services it is very important that we maintain data integrity especially if they are data-centric. It is crucial to have control over the data that the application interacts with to ensure it behaves as expected.

There are many times the data received may get corrupted before reaching the application or the user may provide wrong inputs. This will not create a problem if validations are applied as the application can return invalid requests and may ask the user to provide correct fields, but in the absence of validations, it is sure to cause problems in some instances, as it may process incorrect data and disrupt the flow.

Unit Testing Void Methods with Mockito and JUnit

Writing functionality is the main focus whenever we are writing a software program, but it is equally important that we make sure our code works the way we intended it to. And how do we do that? By writing unit test cases. They are used to test the smallest functionality of code. Unit test cases are an essential part of software development. In this blog, we are going to cover one of the testing scenarios and unit test cases for void methods.

How to Test Void Methods 

As we already know that our aim is to test void methods in a class. But it is also really important to understand why we test void methods. 

Introduction to MongoDB With Java

mongoDBWe now live in a data driven world where we are generating so much data that it becomes difficult to manage this data using databases. There are different databases available for different use cases. For a long time Relational databases were used for most of the uses cases, but as the technology advanced and modern applications came which need more scalability and variety came into picture it became important to choose the right database. This is where one of the No-SQL databases comes in such as MongoDB. In this blog we will have an Introduction to MongoDB and how we can get started with MongoDB with java.

What Is MongoDB?

MongoDB is an open-source non relational, document oriented database. MongoDB being document oriented means that it stores data in JSON like documents which makes it more powerful and expressive. Data is stored in documents in Key pair values.

Building Powerful Contracts Using DAML

As the blockchain technology evolves, there is a need for improved frameworks through which users can create and deploy smart contracts. DAML is one such open-source language for smart contracts originated by Digital Asset.

In this article, we will be understanding about the features of DAML, it’s need and benefits in the current scenarios and the steps to get started with building smart contracts using DAML.