r/JavaProgramming

▲ 197 r/JavaProgramming+2 crossposts

Ran Spring Boot and Node.js side-by-side in prod for 18 months. Sharing the actual numbers.

We had a stack debate on my team back in 2024 that ended with "fine, let's just run both and see." Same microservice, built twice — once in Spring Boot 3.2 / Java 21, once in Node 20 / Express. Same Postgres, same Redis, same AWS ECS setup. 18 months later I went through Cost Explorer and our time tracking.

Sharing the numbers in case anyone else is having this debate:

Infrastructure (18 months):

  • Node.js: ~$10,890 (needed 1GB RAM/instance after month 3)
  • Spring Boot: ~$5,490 (stayed at 512MB the whole time)

Developer time on production issues:

  • Node.js: ~285 hours (memory leaks, npm breaking changes, async race conditions, audit fixes)
  • Spring Boot: ~26 hours (dependency updates, one N+1, pool tuning)

Memory pattern that surprised me most: Node.js instances climbed 180MB → 890MB over 4 days, crashed, restarted. Staircase to hell. Traced to event listener leak in a popular npm package (2M weekly downloads). Spring Boot stayed flat at ~280MB the entire 18 months.

Under Black Friday load (10x normal traffic):

  • Node.js: 3 instances OOM-crashed during peak. Cold start under load: 2.4s.
  • Spring Boot: Zero crashes. Cold start under load: 4.1s (slower, but stable).

Not saying Node is bad. We kept it for internal admin tools and low-traffic stuff. But for customer-facing APIs that need to stay up 24/7, the JVM's 25 years of GC engineering paid for itself many times over.

Curious if anyone else has run this kind of side-by-side. Specifically interested in:

  • Did virtual threads (Java 21) change your scaling math?
  • Anyone tried Bun or Deno in this same comparison? Would they hold up better than Node?
  • How much of the Node memory issue is npm ecosystem vs V8 itself?
medium.com
u/Capable-Morning-9518 — 16 hours ago
▲ 11 r/JavaProgramming+3 crossposts

Looking for a Backend Development Internship opportunity.

Current stack:
• Java
• Spring Boot
• DBMS / SQL
• Docker
• n8n Automation
• Gen AI integrations

I’m ready to work unpaid for the first 2 months to gain real-world industry experience and contribute to actual production-level projects.

Interested only in Backend Development roles.

I’ve worked on automation workflows, APIs, backend systems, and AI-based integrations. Fast learner and ready to handle real engineering tasks.

If any startup, founder, or team is hiring interns or needs backend help, DM me.

Find me in your browser matheshnatarajan.me

reddit.com
u/Training-Clue5547 — 2 days ago
▲ 6 r/JavaProgramming+1 crossposts

Need Help Debugging

As you can see in the video, whenever I move the character up or to the left, there seems to be an issue with chunk loading, black spots appear. It does not seem to be an issue when moving the character down or to the right.

I understand thats a lot of code, but I have been searching for the problem for hours, and just cant find it.

Chunk.Java

package world;

import world.FastNoiseLite;
import java.util.Random;

public class Chunk {

public static final int SIZE = 16;

public int[][] tiles;      // Terrain layer
public int[][] objects;    // Objects layer (trees, etc.)

public int chunkX;
public int chunkY;

private FastNoiseLite noise;

Random rand = new Random();

public Chunk(int chunkX, int chunkY, FastNoiseLite noise) {

this.chunkX = chunkX;
this.chunkY = chunkY;
this.noise = noise;

tiles = new int[SIZE][SIZE];
objects = new int[SIZE][SIZE];  // Initialize objects layer

generateTerrain();

}

private void generateTerrain() {
for(int x = 0; x < SIZE; x++) {
for(int y = 0; y < SIZE; y++) {

int worldX = chunkX * SIZE + x;
int worldY = chunkY * SIZE + y;

float noiseValue = noise.GetNoise(worldX, worldY);

noiseValue = (noiseValue + 1) / 2f;

if(noiseValue < 0.35f) {
tiles[x][y] = 0; // Water
} else if(noiseValue < 0.42f) {
tiles[x][y] = 1; // Sand
} else if(noiseValue < 0.65f) {
tiles[x][y] = 2; // Grass
} else {
tiles[x][y] = 2; // Grass - Forest (lay down grass first)
if(rand.nextInt(100) < 70) {
objects[x][y] = 3; // Tree object on top
}
}
}
}
}

}

And some more code

World.Java

package world;

import world.FastNoiseLite;
import java.util.HashMap;

public class World {

public long seed;
public FastNoiseLite noise;

private HashMap<String, Chunk> chunks;

public World(long seed) {
this.seed = seed;

noise = new FastNoiseLite((int)seed);
noise.SetNoiseType(FastNoiseLite.NoiseType.Perlin);
noise.SetFrequency(0.05f);

chunks = new HashMap<>();
}

public Chunk getOrCreateChunk(int chunkX, int chunkY) {
String key = chunkX + "," + chunkY;
if (!chunks.containsKey(key)) {
chunks.put(key, new Chunk(chunkX, chunkY, noise));
}
return chunks.get(key);
}

public Chunk getChunk(int chunkX, int chunkY) {
String key = chunkX + "," + chunkY;
return chunks.get(key);
}

}

And finally a snippet of code

 public void run() {  
double drawInterval = 1000000000/fps; 
double delta = 0; 
double lastTime = System.nanoTime(); 
long currentTime; 
long timer = 0; 
int 
drawCount
 = 0;  
while(gameThread != null) {  
currentTime = System.nanoTime();  
delta += (currentTime - lastTime) / drawInterval; 
timer += (currentTime - lastTime); 
lastTime = currentTime;  
if(delta >= 1) { 
double deltaTime = 1.0 / fps; 
// Pass delta time in seconds 
update(deltaTime); 
repaint(); 
delta--; 
drawCount++; }  
if(timer >= 1000000000) { 
drawCount = 0;
 timer = 0; }  } }  
u/Override protected void paintComponent(Graphics g) { 
super.paintComponent(g);  Graphics2D g2 = (Graphics2D)g;  g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);  // Calculate which tiles are visible (in world coordinates) int startTileX = (int)((cameraX - tileSize) / tileSize); int startTileY = (int)((cameraY - tileSize) / tileSize); int endTileX = (int)((cameraX + screenWidth) / tileSize) + 1; int endTileY = (int)((cameraY + screenHeight) / tileSize) + 1;  // Render all visible tiles for(int tileY = startTileY; tileY <= endTileY; tileY++) { for(int tileX = startTileX; tileX <= endTileX; tileX++) { int chunkX = tileX / Chunk.SIZE; int chunkY = tileY / Chunk.SIZE; int localX = tileX - (chunkX * Chunk.SIZE); int localY = tileY - (chunkY * Chunk.SIZE);  // Handle negative coordinates if(localX < 0) { chunkX--; localX += Chunk.SIZE; } if(localY < 0) { chunkY--; localY += Chunk.SIZE; }  Chunk chunk = world.getChunk(chunkX, chunkY); if(chunk == null) continue;  int tile = chunk.tiles[localX][localY];  // Calculate screen position int screenX = (int)(tileX * tileSize - cameraX); int screenY = (int)(tileY * tileSize - cameraY);  // Render terrain tile switch(tile) { case 0: g2.drawImage(tileM.tile[3].image, screenX, screenY, tileSize, tileSize, null); break; case 1: g2.drawImage(tileM.tile[2].image, screenX, screenY, tileSize, tileSize, null); break; case 2: g2.drawImage(tileM.tile[0].image, screenX, screenY, tileSize, tileSize, null); break; }  // Render object on top (trees, etc.) int object = chunk.objects[localX][localY]; if(object > 0) { switch(object) { case 3: g2.drawImage(tileM.tile[1].image, screenX, screenY, tileSize, tileSize, null); break; } } } }
u/WJava_Game_Dev — 3 days ago
▲ 3 r/JavaProgramming+1 crossposts

Type-safe SQL in Java without the bloat: Inferred JOINs based on JPA annotations

Hi everyone,

I’ve been working on a lightweight ORM module for Ujorm3, aiming for a sweet spot between raw native SQL safety and the heavy weight of full-blown ORMs like Hibernate.

One of the neat features we implemented is automatic JOIN type resolution derived directly from standard JPA metadata (like nullable=false), combined with a compile-time generated metamodel.

Here is a quick look at how a SelectQuery handles relations, multiple tables, and custom SQL tails fluently:

final var ctx = EntityContext.ofDefault();
final var employeeEm = ctx.entityManager(Employee.class);

List<Employee> select(Connection connection) {
  return SelectQuery.run(connection, employeeEm, query -> query
    .sql("SELECT")  // Optional custom start
    .columns(true)  // Loads all table columns including foreign keys
    .column(MetaEmployee.city, MetaCity.name)     // Auto-generates INNER JOIN 
    .column(MetaEmployee.boss, MetaEmployee.name) // Auto-generates LEFT JOIN 
    .where(MetaEmployee.id.whereGe(1L).and(MetaCity.id.whereGe(1L)))
    .tail("ORDER BY", MetaEmployee.id) // Optional custom end
    .toList()
    );
}

How it works under the hood:

  • Zero Reflection at Runtime: The library compiles its own bytecode at runtime for lightning-fast domain object manipulation, matching the speed of handwritten Java.
  • Smart JOINs: If a mandatory object attribute is marked as nullable=false in your JPA annotation, the query engine automatically spins up an INNER JOIN. Otherwise, it defaults to a LEFT JOIN. No manual string stitching required.
  • Type-Safe Path Mapping: Notice the MetaEmployee.city, MetaCity.name chain? It provides a compile-time safe path for multi-relational mappings, backed by an APT processor.

The goal here was keeping the codebase minimalistic to extend maintainability and eliminate runtime surprises (like dreaded lazy-loading exceptions, since we chose not to support lazy-loading at all).

I'd love to hear your thoughts on this approach! Do you prefer your SQL builders strictly native, or do you like this level of automation?

reddit.com
u/Enough_Arrival_7335 — 4 days ago
▲ 10 r/JavaProgramming+1 crossposts

Review my resume please, I can't find an internship!

Hello, I'm 23 already:(, with a college degree in computer science(~5 years of studying), I chose not to do university cuz of wasting time, I started to learn java backend by myself, them applied to multiple internship or entry level jobs and no one asked me.

Please tell me what's wrong ? Maybe I must learn microservices or more advanced technologies? Or to do university? The market place is so bad nowadays, guys help please, any advice will be a blessing!

u/Traditional_Base_805 — 8 days ago
▲ 7 r/JavaProgramming+1 crossposts

Switching Java versions on Windows is a real hassle, so I built a CLI to make it fast and seamless.

jir

Language: English | 中文

jir helps you manage Java versions without fighting JAVA_HOME.

Install a JDK, switch to it, and keep your active Java runtime behind one stable path: home/occupy.

Why

If you often switch between Java 8, 17, 21, or different vendors like Temurin, Corretto, Zulu, Oracle, and Microsoft OpenJDK, jir keeps that workflow simple.

You can set JAVA_HOME to home/occupy once. After that, jir use 21:temurin switches Java without editing environment variables again.

On Windows, switching uses a directory junction, so it is fast and does not copy the whole JDK.

Install

Download or build the Windows GUI installer:

dist/jir-0.1.0-windows-x64-gui-setup.exe

The installer lets you choose where jir lives. It can also add jir to PATH and set JAVA_HOME for you.

After installing, open a new terminal and check:

jir -h

Quick Start

See what you can install:

jir ls -i

Install Java 21. If there are multiple vendors, jir will let you choose one:

jir i 21

Already know what you want?

jir i 21:temurin

Switch to it:

jir use 21:temurin

Check what is active:

jir current

Remove something you no longer need:

jir uni 21:temurin

Commands

  • jir, jir -h, jir -help, jir --help: show help.
  • jir ls: show installed JDKs.
  • jir ls -i: show installable JDKs.
  • jir i 21: install Java 21 and choose a vendor.
  • jir i 21:temurin: install a specific distro.
  • jir use 21: choose an installed Java 21 distro and activate it.
  • jir use 21:temurin: activate a specific installed distro.
  • jir current: show the active Java runtime.
  • jir uni 21:temurin: uninstall a JDK after confirmation.
github.com
u/Playful_Call_9219 — 6 days ago

[Hiring] Java Developers, Remote

Quick post, we’re looking to bring on a couple Java devs.

We’re a small team, pretty laid-back, and we try to keep things practical. No heavy process or endless meetings. Mostly just building solid software, solving problems, and helping each other out when needed.

Looking for someone with around 1+ year of experience who’s comfortable building features, fixing bugs, improving performance, and working on real production systems.

Mainly looking for people strong with:

• Java / Spring Boot

• APIs & backend systems

• SQL/databases

• Bonus if you’ve worked with cloud or microservices stuff

What the setup looks like:

• Fully remote

• Flexible hours

• Part-time or full-time

• $27–49/hr depending on experience

Mostly just looking for reliable people who communicate well and enjoy building things.

If interested, send over a quick intro, what you’ve been working with, and where you’re based 📍

reddit.com
u/Cute-Ring-1952 — 10 days ago

Java Operators Quiz: 30 MCQ Questions You Should Solve that will Improve Problem-Solving Skills

Test your programming logic with these top 30 Java Operators Quiz questions from basic to advanced levels.

Whether you are a beginner, student, coding learner, or preparing for interviews, this quiz will challenge your Java operator fundamentals and improve your problem-solving skills.

Take the quiz now and see how many questions you can answer correctly! Can you score 30/30? Comment your score.

https://www.scientecheasy.com/2026/05/java-operators-quiz.html/

reddit.com
u/scientecheasy — 7 days ago

Java or Python

Hi ppl,

I'm 21, Working in an monitoring kind of role. I need to parallelly upskill myself and look for a switch. Java or Python, which one should I learn to become a full stack developer?

reddit.com
u/spiderman-1610 — 12 days ago
▲ 20 r/JavaProgramming+1 crossposts

MGM sim

Tryna train for the mgm and made a program and I clearly don’t know wtf I’m doing lol

u/Ok_Ad_2914 — 11 days ago

JAVA practice

hi

I'm looking for a java practice partner, advanced level.

I understand things, but somehow days go by without coding.

I'm only active when I'm talking to someone while practicing, otherwise I'm somehow uninterested 😞

reddit.com
u/Dear-Cap-1836 — 12 days ago
▲ 8 r/JavaProgramming+1 crossposts

Miglior framework AI per Java?

Ciao a tutti, dovrei sviluppare un'applicazione Java che genera del contenuto AI in base a contenuti inseriti dall'utente.

Sono indeciso se utilizzare LangChain4j o Spring AI.

Cosa mi consigliate?

reddit.com
u/encol01 — 10 days ago