Skip to main content

r/SpringBoot


Sizing application in Kubernetes
Sizing application in Kubernetes

How are you sizing your applications?

Our stack mainly consists of Spring Boot applications with Oracle and MongoDB databases running on Kubernetes. I'm not sure whether we've focused too much on the "micro" aspect of the microservices concept.

Most Kubernetes replicas are configured with a maximum of 1 GB of memory and CPU limits of up to 800 millicores. When an application requires more resources, our primary approach is to increase the number of replicas. I believe there is a strong rationale for this, particularly from a resilience and availability perspective. However, I'm not sure whether we're giving up some benefits by keeping our applications this small (for example, losing access to certain JVM optimizations or garbage collectors). Correct me if I'm wrong, but I believe applications limited to less than one CPU core may not be able to take full advantage of Parallel GC and might fall back to Serial GC instead.


Advertisement: Heroes aren't born. They're built here. Discover action games on Roblox.
Heroes aren't born. They're built here. Discover action games on Roblox.
Image Heroes aren't born. They're built here. Discover action games on Roblox.


200+ Star Spring Boot Roadmap From Zero to Microservices
200+ Star Spring Boot Roadmap From Zero to Microservices
Image r/SpringBoot - 200+ Star Spring Boot Roadmap From Zero to Microservices

I added Spring Boot support to my open source job scheduler
I added Spring Boot support to my open source job scheduler

Ratchet is a background job scheduler. You inject one service and pass it a method reference. The job is saved in your database, retried if it fails, and recovered if the app crashes. If you submit it inside a transaction that rolls back, the job goes too.

@Transactional
void place(Order order) {
  orders.save(order);
  scheduler.enqueue(() -> fulfillment.ship(order.id())).submit();
}

0.5.0 supports Boot 3.5 and 4.1, five databases, and native images. Apache 2.0.

Quickstart: https://ratchet.run/deployment/spring-boot

Repo: https://github.com/ratchet-run/ratchet

If something breaks on your setup, open an issue and I'll take a look.