Posts

Showing posts with the label AWS RDS

AWS Lambda Explained with a Simple Java Example

AWS Lambda is a fully serverless compute service that lets you run code without provisioning or managing servers. You are billed only for the time your function actually runs—unlike EC2, where you pay even when the server is idle. Lambda automatically scales, executes only when triggered, and shuts down after execution. What AWS Lambda Does Runs small pieces of code called functions written in Java, Python, Node.js, Ruby, and more. No server, OS, CPU, RAM, or patching management—AWS handles everything. Billed only per invocation and execution time. Ideal for event-driven, bursty, or low-traffic workloads. How AWS Lambda is Triggered A Lambda function does nothing until a trigger fires. Common triggers include: S3 — Run code when files are uploaded or deleted (e.g., image resizing). SQS / SNS — Process messages as they arrive. API Gateway — Build serverless REST APIs where each HTTP call invokes Lambda. EventBridge / CloudWatch — Cron jobs...

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...