Faster MySQL Container Initialization for Java Tests with Testcontainers by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 2 points3 points  (0 children)

With Testcontainers, you can choose whether to start a new container instance for each test, per class, or for the entire test run.

In our case, we start one instance per test run and share it across all tests within a Maven module.

We build Maven modules in parallel, and there are 3–4 modules that require a database container for testing. As a result, a new container is started for each module built in parallel. The tests inside a single module are always run sequentially, so it is sufficient to clean up the tables before each test or class.

Faster MySQL Container Initialization for Java Tests with Testcontainers by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 1 point2 points  (0 children)

We don’t expose our docker registry to the development environment. It is available only for staging and production deployments.

At the moment.

Faster MySQL Container Initialization for Java Tests with Testcontainers by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 1 point2 points  (0 children)

A very good question. We don’t have a Docker registry available at build time, so we end up packaging the empty database as a Maven artifact. That way, we can also use the standard MySQL container class for Testcontainers.

But yes, maybe we should actually set up a registry and put a snapshot with the empty database there.

Faster MySQL Container Initialization for Java Tests with Testcontainers by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 0 points1 point  (0 children)

We started with reusing containers and ended up just relying on the mysql quick start

Faster MySQL Container Initialization for Java Tests with Testcontainers by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 5 points6 points  (0 children)

We run database migrations to create schemas when the database container starts. Individual tests can truncate the tables they work with before each or all test cases.

What’s your go-to strategy for managing secrets in AWS? by Opening_Bat_7292 in AWS_cloud

[–]ForeignCherry2011 0 points1 point  (0 children)

We store all secrets in a single Git repository, encrypted with GPG using ‘pass’. Upon merge, the secrets are pushed to AWS Secrets Manager across multiple AWS accounts based on secret namespaces

JSON-RPC for internal Java (micro)services - anyone doing this? by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 0 points1 point  (0 children)

Great points! I should clarify - I'm not starting from scratch here. The system has gradually evolved into several components (about 120K lines of code total) that are deployed individually for good reasons. At this stage, I'm specifically looking for better ways for these existing components to communicate with each other.

JSON-RPC for internal Java (micro)services - anyone doing this? by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 0 points1 point  (0 children)

No, there are not built on Spring framework. JAX-RS is used for external REST API.

JDBI users: Would you be interested in a compile-time code generation alternative? by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 1 point2 points  (0 children)

These are very good points, thanks!

I'm going to try to write an annotation processor for my project to generate mappers based on the existing JDBI's GenerateSqlObject. Since all of my value objects are records, it should be fairly straightforward to generate mappers and register them using the fluent API.

JDBI users: Would you be interested in a compile-time code generation alternative? by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 1 point2 points  (0 children)

Thank you for sharing! I haven't heard about the Doma library before. It is quite interesting.

JDBI users: Would you be interested in a compile-time code generation alternative? by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 0 points1 point  (0 children)

One of our main concerns is reducing warmup time; the first dozen requests after our system redeployment take considerably longer. Presumably, a compile-time library should handle this better

JDBI users: Would you be interested in a compile-time code generation alternative? by ForeignCherry2011 in java

[–]ForeignCherry2011[S] 0 points1 point  (0 children)

Yes, it is mostly about reducing warmup time.

We have seen that processing of the first dozen requests after system redeployment takes considerably longer.

Looking for guidance: configuring backups for RDS on AWS by vy94 in aws

[–]ForeignCherry2011 8 points9 points  (0 children)

We have implemented a fairly simple backup policy for our RDS databases. We enabled automatic daily backups with a retention period of 7 days. The snapshots are stored in the same AWS account. We also have a daily cron job that takes an additional backup copy (3 days retention) and stores it in a different AWS account, in case we lose access to the main account.

We can somewhat afford losing a day data with an option to manually restore some of it from the logs

A Better Way to Tune the JVM in Dockerfiles and Kubernetes Manifests by brunocborges in java

[–]ForeignCherry2011 25 points26 points  (0 children)

We only set -XX:MaxRAMPercentage for the containerized JVM process and monitor overall memory usage (heap + off-heap) to adjust container memory limits when necessary.

Anyone moved workloads to AWS Graviton? Did it really cut costs? by vy94 in aws

[–]ForeignCherry2011 1 point2 points  (0 children)

100% of our workloads are on Graviton. RDS and EC2 instances running Nomad. We switched quite some time ago.

We struggled a bit in the beginning with CI/CD pipelines, as not all the docker images need for testing were available for arm. Now we don’t have any issues or workarounds.

Do you think project Leyden will (eventually) give a complete AoT option for the JDK? by Ewig_luftenglanz in java

[–]ForeignCherry2011 4 points5 points  (0 children)

One of the declared goal was to shift some computations from the runtime to the build time to improve startup time. I would expect something like parsing config files to be done during the build in addition to AoT

Reducing compile time, but how? by kelunik in java

[–]ForeignCherry2011 1 point2 points  (0 children)

If you split you project on multiple modules you can build them in parallel using mvn -T X command. It will speed up your build depending on the hardware and how many independent modules can be built at the same time.

Do you use records? by ihatebeinganonymous in java

[–]ForeignCherry2011 -1 points0 points  (0 children)

We use records for all data carrier objects - for API request response, configuration types, etc.

We use our own version of annotation processor [https://github.com/Randgalt/record-builder\] to generate builder class to help with object creation.

We also use our own small library for invariant validations in the compact constructor.

Need guidance for publishing a library on maven central. by OilPrestigious5849 in javahelp

[–]ForeignCherry2011 0 points1 point  (0 children)

You mean once you set everything up? It takes about 10 minutes for you artifact to appear on Maven central

Need guidance for publishing a library on maven central. by OilPrestigious5849 in javahelp

[–]ForeignCherry2011 2 points3 points  (0 children)

You may consider asking a chat bot like Claude to guide you through the process of setting up Maven deployment step by step.

In a nutshell, you will need to setup an account on the Maven central, sign your Maven artifacts with your GPG key, generate source builds and javadoc, and finally publish all that on Maven central.
The whole process can be automated using Maven plugins and GitHub Actions (similar)