Posts

Showing posts with the label RDS MySQL

Spring Boot + AWS RDS MySQL: Connect Your App to Cloud DB

Connecting a Spring Boot application to AWS RDS MySQL is almost identical to using a local MySQL instance. Only the datasource URL, username, and password change—your Spring Boot, JPA, Hibernate, and repository code remain the same. Step 1: Local MySQL Setup with Spring Boot Create a Spring Boot project from Spring Initializr with: Spring Web Spring Data JPA MySQL Driver Below is an example Product entity : package com.example.demo.entity; import jakarta.persistence.*; @Entity public class Product { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private double price; // getters and setters } Product JPA Repository: package com.example.demo.repository; import com.example.demo.entity.Product; import org.springframework.data.jpa.repository.JpaRepository; public interface ProductRepository extends JpaRepository { } Product REST Controller: package com.example.demo.contr...

AWS RDS Tutorial for Beginners: Launch MySQL and Connect from Terminal

A relational database stores data in tables with rows and columns . Example: a products table with columns like id, name, description, price, and stock. These tables can be related using keys. Popular relational databases include MySQL, PostgreSQL, Oracle, MariaDB, and SQL Server. When deploying applications (for example on EC2), they typically need one of these relational databases to store application data. What is AWS RDS? Amazon RDS (Relational Database Service) is a managed database service that allows you to create, operate, and scale relational databases without managing the underlying servers. RDS automatically handles: Provisioning Backups Patching Monitoring Supported engines: Amazon Aurora (MySQL/PostgreSQL compatible) MySQL PostgreSQL MariaDB Oracle Microsoft SQL Server IBM Db2 You connect to RDS databases using normal CLI tools or JDBC URLs. Create an RDS MySQL Database (Free Tier) Open the RDS Console → Clic...