Spring Data: Easy MongoDB Migration Using Mongock

In one of my projects, I was looking for some simple options to manage MongoDB database schema changes similar to other projects like Flyway or Liquibase. I found Mongock, which is an open-source Java MongoDB tool.

Prerequisites

  • Spring Boot 2.5.0
  • Maven 3.6.1
  • JAVA 11
  • Mongo 4.4

Getting Started

We will start by creating a simple Spring Boot project from start.spring.io, with the following dependencies: Web, MongoDB, and Lombok.

Multi-Tenancy Implementation Using Spring Boot, MongoDB, and Redis

In this tutorial, we will learn how to implement multi-tenancy in a Spring Boot application with MongoDB and Redis.

Prerequisites

  • Spring Boot 2.4
  • Maven 3.6.+
  • JAVA 8+
  • Mongo 4.4
  • Redis 5

What Is Multi-tenancy?

Multi-tenancy is a software architecture in which a single instance of a software application serves multiple customers. Everything should be shared, except for the different customers’ data, which should be properly separated. Despite the fact that they share resources, tenants aren’t aware of each other, and their data is kept totally separate. Each customer is called a tenant.

Spring Data: Data Auditing Using JaVers and MongoDB

Recently I was looking for some simple options to track all changes to entities in all my microservices. After researching, I discovered the Java library named JaVers. It is designed as a framework for auditing changes in object-oriented data.

In this post, we’ll see how to use JaVers in a simple Spring Boot application and MongoDB environment to track changes of entities.

Spring Boot – Unit Test your project architecture with ArchUnit

When building software, it's common for development teams to define a set of guidelines and code conventions that are considered best practices.

These are practices that are generally documented and communicated to the entire development team that has accepted them. However, during development, developers can violate these guidelines which are discovered during code reviews or with code quality checking tools.