Connect to a Database Instance Running Inside a Java Testcontainer Using IntelliJ IDEA

JUnit is one of the most popular unit testing frameworks used with Java to create repeatable tests. With JUnit, each test is written as a separate method inside a Java class. IntelliJ IDEA provides an option to run these test cases from within the IDE.

In case you have a module that communicates with a MySQL database, you can unit test the module by providing it access to a MySQL server running inside a Testcontainer. You can also configure this MySQL database instance with your desired username, password, and database name (in MySQL server) using the API provided by the Testcontainers framework.

mysqldump Best Practices (Part 1): MySQL Prerequisites

mysqldump is a client utility that is used to perform logical backups of the MySQL database. This popular migration tool is useful for various use cases of MySQL such as:

  • Backup and restore of databases.
  • Migrating data from one server to another.
  • Migrating data across different managed MySQL service providers.
  • Migrating data between different versions of MySQL.

mysqldump works by reading the source database objects and generating a set of SQL statements that are stored in a dump file. By replaying these statements on the destination database server, the original data is reconstructed. Since this model uses a reading of the whole database and then essentially rebuilding, both dump and restore are time-consuming operations for a large database. The process might even turn cumbersome if you encounter errors during either dump or restore as it may lead you to fix the issues and re-run the operations. This is why it's important to plan well before you take up the dump and restore activity.

Create a Scale-Out Hive Cluster With a Distributed, MySQL-Compatible Database

Hive Metastore supports various backend databases, among which MySQL is the most commonly used. However, in real-world scenarios, MySQL's shortcoming is obvious: as metadata grows in Hive, MySQL is limited by its standalone performance and can't deliver good performance. When individual MySQL databases form a cluster, the complexity drastically increases. In scenarios with huge amounts of metadata (for example, a single table has more than 10 million or even 100 million rows of data), MySQL is not a good choice.

We had this problem, and our migration story proves that TiDB, an open-source distributed Hybrid Transactional/Analytical Processing (HTAP) database, is a perfect solution in these scenarios.

GraphQL With Java Spring Boot and Postgres or MySQL Made Easy!

GraphQL is revolutionising the way developers build APIs. It lets you query precisely what you want. Nothing more, nothing less! It also gives you the flexibility to query related objects in a single round trip, unlike REST APIs. 

In this blog post, we are going to experience GraphQLize, a JVM library for developing a GraphQL API instantly from Postgres and MySQL databases.

How to Connect a MySQL Database to a Vaadin Application (Part 2)

This tutorial focuses on how to wire your web application to a MySQL database so you can Create, Read, Update, and Delete (CRUD) information in a database via a Vaadin web application. The idea is to show you how to connect a template project downloaded from https://start.vaadin.com to a database so you can replicate it to your own needs. This is not about best practices (for Vaadin, Spring, or MySQL) but to help you get started fast.

You can find the code used in this tutorial from GitHub.