Skip to content

Software Engineering Blog

Comparing Human and AI way for Big-String-Set Intersection Performance in Java by JMH

cover.png

Recently, I'm facing a case on my job, comparing two set of users and find the intersection as the result. But the difficult part is the number of set is quite big (both sets could be 10,000+ elements). To provide a better experiment for our users, the speed can not be too slow. So I want to find a relatively quick way to do the intersection work.

In this article, I use AI (Gemini, ChatGPT) and the 'old-school' way, Stackoverflow to find several ways to do the set intersection. And Use the JMH Java Microbenchmark Harness to run all the test and produce report.

Spring Boot 3.1 Docker Compose Support: The Most Intuitive and Consistent Way to Develop and Run Tests with Containers

SB-Docker-cover.png

Spring-Boot-Docker-Compose is a very powerful tool to help developer in their daily job. Help the Spring Boot app start with docker-compose up automatically. In Both development and running tests. This tiny automation actually brings huge benefits to both developer experiment and engineering practice

In this article, we will cover:

  • The challenges faced before adoption.
  • How to implement it.
  • Setup tips for optimal usage.
  • A summary of the advantages.

5 Steps to Make Gradle Configuration Extreme Clean in a Multi-Module Project

Clean Grade-2.jpg

Multi-module Gradle projects involve numerous tasks during the build process. Managing dependency version control, plugin usage, build logic, and more with Gradle proves to be a popular and effective approach. But, achieving these tasks requires a lot of configuration scripts, which can make the file more complicated, and more difficult for development. These steps in the article will guide you through a clean and efficient way to manage configuration files:

Mysql Trap when DB Read-Write Separate and Parent-Child Relationship Schema without Transaction

Db_Replica_Trap_Cover.png

DB replicas are essential for data-intensive systems. First, we can accelerate our performance by writing to the master and reading from replicas, which can have many instances or be geographically close to users. Second, the replica DB can serve as a backup for the system. No matter what happens to the main DB, it can be a data recovery source or even become the new main DB to reduce downtime.

It's no secret that the trade-off for using a read-write separation mechanism is so-called "data inconsistency." The solutions to avoid this situation depend on the use cases and the architecture. In this article, we will go through the MySQL binlog mechanism and what would happen if we don't use transaction when insert/update parent-child relationship data. Let's start!

High Availability Deployment by Pod Topology Spread Constraints in K8s Cluster

In the modern world, running a high-availability service is the most important thing for the users. As Kubernetes is getting more common, it's essential to know how to achieve a robust deployment across all the Applications. Assuming the network unreliability is handled by the Application retry and idempotency mechanism, what's left is to make sure the Applications are running well. The only threat is some "real-world" damage to the server. so we are always told to spread our application across different server-rack, data center zones, or geography regions.

In this article, we will share:

  1. Related K8s labels to be used
  2. How to use the Pod Topology Spread Constraints
  3. How would it work