QTPortfolio
PostgreSQL on Neon: Serverless Database for Modern Apps
PostgreSQLNeonDatabaseSpring Boot

PostgreSQL on Neon: Serverless Database for Modern Apps

April 6, 20261 min read~109 words

What is Neon?

Neon is a serverless PostgreSQL provider that separates storage from compute. This means your database can scale to zero when not in use, dramatically reducing costs for personal projects.

Key Features

  • Branching: Create database branches for dev/staging just like Git branches
  • Scale-to-zero: Compute pauses automatically when idle
  • Connection pooling: Built-in PgBouncer support
  • Point-in-time restore: 24-hour history on the free tier

Connecting Spring Boot to Neon

# application.yml
spring:
  datasource:
    url: ${NEON_JDBC_URL:jdbc:postgresql://localhost:5432/portfolio}
    username: ${NEON_USERNAME:postgres}
    password: ${NEON_PASSWORD:postgres}
    hikari:
      maximum-pool-size: 5
      minimum-idle: 1
      connection-timeout: 30000

Performance Tips

Since Neon can have cold-start latency, configure your Spring Boot app to keep connections warm with HikariCP's keepaliveTime setting.

Enjoyed this article?

Share it with your network or explore more posts below.