Java/Cloud: How to Quickly Create a Kubernetes-Ready REST Microservice

It is safe to say that the Microservice + Cloud combination is all the rage these days. Microservices are being developed more than ever, in turn increasing the number of application deployments. During the past decade, containerization and orchestration tools such as Docker and Kubernetes were developed, making the microservice pattern easy to adopt.

This article will teach you how to generate a completely functional microservice with an exposed REST API capable of interacting with a MySQL database and deploy it to your local Kubernetes cluster. The learnings here can be applied to almost any database type like Oracle, SQL Server, DB2, and so on.

Java: How to Create Lightweight Database Microservices

Build database microservices that are as light as a feather!

The number of cloud-based Java database applications grows by the minute. Many organizations deploy hundreds — if not thousands — of microservice instances. However, most applications carry an astounding amount of unnecessary overhead with respect to the runtime environment. This, in turn, makes the application slower and more expensive to run.

In this article, I will demonstrate how to write a database application that is 10 times smaller than normal(*). The storage requirement will be about 32 MB instead of the usual(*) ~300 MB taking both the application, third-party libraries, and the Java runtime into account. As a bonus, the required RAM to run the application will also be reduced by 25 percent.

Become a Master of Java Streams (Part 4): Database Streams

You can almost see the data flowing...

SQL has always been a declarative language whereas Java for a long time has been imperative. Java streams have changed the game. Code your way through this hands-on-lab article and learn how Java streams can be used to perform declarative queries to an RDBMS database, without writing a single line of SQL code. You will discover, there is a remarkable similarity between the verbs of Java streams and SQL commands.

Not quite what you're looking for? Take a look at Querying Databases Using Java Streams.

This article is the fourth out of five, complemented by a GitHub repository containing instructions and exercises to each unit.