Hello! In this tutorial, we will learn how to Sequelize ORM in Node.js Application. More specifically, we will build a RESTful application in a Node.js environment running on an Express.js server and PostgreSQL database to perform the CURD operations. We will also use the promise-based ORM dependency known as Sequelize to create the data model. 1. Introduction RESTful API stands ...
Read More »Home »
Run a docker PostgreSQL instance locally for Testing
Running a PostgreSQL instance ad-hoc for testing is not always as bootstraping as it should be. This blog will run a PostgreSQL instance that connects to your workstation’s network and instead of using one of the popular tools like dbeaver we shall use the client that comes with the instance. Also we shall run a bootstrap script to have some ...
Read More »Spring Boot tests with Testcontainers and PostgreSQL, MySQL or MariaDB
Testcontainers is a Java library that allows integrating Docker containers in JUnit tests with ease. In a Containerized World, there is little sense to complicate the tests configuration with embedded databases and services. Instead, use run your services in Docker and let the Testcontainers manage this for you. In this blog post you will learn how to configure Testcontainers to ...
Read More »Docker Compose for Spring Boot application with PostgreSQL
In this blog post you will learn how to configure Spring Boot application with PostgreSQL for running with Docker Compose. This blog post covers: Spring Boot application Dockerfile configuration with clean separation between dependencies and resourcesDocker Compose configuration for running the application with PostgreSQL Prerequisites DockerJava 13Terminalhttpie (or curl) Application Generate the Maven based Spring Boot application with Spring Web, ...
Read More »Quarkus tests with Testcontainers and PostgreSQL
Testcontainers is a Java library that allows integrating Docker containers in JUnit tests with ease. In a Containerized World, there is little sense to complicate the tests configuration with embedded databases and services. Instead, use run your services in Docker and let the Testcontainers manage this for you. So if you are need Redis, MongoDB or PostgreSQL in your tests ...
Read More »Read replicas and Spring Data Part 4: Configuring the read repository
Previously we set up two EntityManagers in the same application. One for the reads and one for the writes. Now it’s time to create our read repository. The read only repository will use the secondary read only EntityManager. In order to make it a read only repository, it is essential not to have any save and persist actions. 01 02 ...
Read More »Read replicas and Spring Data Part 3: Configuring two entity managers
Our previous setup works as expected. What we shall do now is to get one step further and configure two separate entity managers without affecting the functionality we achieved previously. The first step would be to set the default entity manager configuration to a primary one.This is the first step 01 02 03 04 05 06 07 08 09 10 ...
Read More »Read replicas and Spring Data Part 2: Configuring the base project
In our previous post we set up multiple PostgreSQL instances with the same data.Our next step would be to configure our spring project by using the both servers. As stated previously we shall use some of the code taken from the Spring Boot JPA post, since we use exactly the same database. This shall be our gradle build file 01 ...
Read More »Running PostgreSQL in a Cloud on Oracle Containers Engine for Kubernetes
In this post I am going to show a few steps to deploy and run PostgreSQL database in a K8S cluster on OKE.The deployment is going to be based on postgres:11.1 Docker image which requires a few environment variables to be configured: POSTGRES_DB (database name), POSTGRES_USER and POSTGRES_PASSWORD. I am going to store values of these variables in K8S ConfigMap ...
Read More »