Tech Assessment: Church Member & Service Management System

Target organisation: The Church of Jesus Christ of Latter-day Saints (LDS Church). This document describes a serverless, cost-efficient solution using AWS services and the AWS SDK for Java.

Objective

Design and implement a serverless system to manage members and service activities for a local church unit. The solution must be secure, scalable, reproducible via Infrastructure-as-Code, and cost-aware. It demonstrates practical use of AWS SDK for Java, Lambda, API Gateway, Aurora Serverless v2, S3, and CloudFormation.

Detailed Requirements

Entities & Fields

Member
Fields:
  • member_id (UUID, PK)
  • first_name (String)
  • last_name (String)
  • date_of_birth (Date)
  • email (String)
  • phone_number (String)
  • ward (String)
  • calling (String, optional)
  • created_at, updated_at (Timestamps)
ServiceActivity
Fields:
  • activity_id (UUID, PK)
  • name (String)
  • description (String, optional)
  • date (Date)
  • location (String, optional)
  • leader_id (UUID, FK → Member.member_id)
  • created_at, updated_at (Timestamps)
ActivityParticipant
Fields:
  • participant_id (UUID, PK)
  • activity_id (UUID, FK → ServiceActivity.activity_id)
  • member_id (UUID, FK → Member.member_id)
  • role (String, optional)
Attachment
Fields:
  • attachment_id (UUID, PK)
  • owner_type (Enum: MEMBER or ACTIVITY)
  • owner_id (UUID)
  • filename (String)
  • s3_key (String)
  • uploaded_at (Timestamp)

Relationships

AWS Architecture Overview

  1. AWS Lambda (Java): All business logic runs in Lambda functions (CRUD handlers). Use Spring Cloud Function or Function beans for easy adaptation.
  2. API Gateway: REST endpoints (e.g., /members, /activities) using AWS_PROXY integration to Lambda.
  3. Aurora Serverless v2 (MySQL): Relational storage accessed via RDS Data API from Lambda (no persistent DB connections).
  4. Amazon S3: Store attachments and static assets (React build if chosen).
  5. CloudFormation: Define stacks for Lambda, API Gateway, S3, IAM Roles, and optionally Aurora cluster skeleton.
  6. CloudWatch & Budgets: Logs, metrics, and budget alerts for cost control.

API & Endpoints

HTTPPathAction
GET/membersList members (pagination)
POST/membersCreate member
GET/members/{id}Get by ID
PUT/members/{id}Update member
DELETE/members/{id}Delete member
POST/activitiesCreate activity
GET/activities/{id}Get activity details
POST/activities/{id}/participantsAdd participant
POST/attachmentsUpload file (S3)

Implementation Details

1. Spring Boot Lambda (Java)

Use Spring Cloud Function to map functions to Lambda. For local testing you can keep a @RestController while providing Function beans for Lambda deployment.

Example Function bean

@Bean
public Function hello() {
    return name -> "Hello, " + (name == null ? "World" : name) + "!";
}

2. RDS Data API (Aurora Serverless)

Create tables via the RDS Data API or migration scripts. Example SQL executed from Java:

ExecuteStatementRequest request = ExecuteStatementRequest.builder()
    .resourceArn(System.getenv("DB_ARN"))
    .secretArn(System.getenv("DB_SECRET"))
    .database("ChurchDB")
    .sql("CREATE TABLE IF NOT EXISTS Members (...)")
    .build();
rdsClient.executeStatement(request);

3. File uploads to S3

S3Client s3 = S3Client.create();
s3.putObject(PutObjectRequest.builder()
    .bucket(System.getenv("S3_BUCKET"))
    .key("members/" + memberId + "/photo.jpg")
    .build(), RequestBody.fromFile(Paths.get("photo.jpg")));

4. Sending notifications (SNS)

SnsClient sns = SnsClient.create();
sns.publish(PublishRequest.builder()
    .topicArn("arn:aws:sns:...:NewMemberTopic")
    .message("A new member was added")
    .build());

CloudFormation Template Example (Skeleton)

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  LambdaExecutionRole:
    Type: AWS::IAM::Role
    Properties: ...

  HelloLambdaFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: HelloSpringLambda
      Handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
      Runtime: java17
      Role: !GetAtt LambdaExecutionRole.Arn
      Code:
        S3Bucket: your-bucket-name
        S3Key: your-springboot-lambda.jar

  HelloApi:
    Type: AWS::ApiGateway::RestApi
    Properties: ...

  LambdaPermissionForApi:
    Type: AWS::Lambda::Permission
    Properties: ...

Deploy Steps

  1. Package Spring Boot app as a fat JAR: mvn clean package.
  2. Upload JAR to S3: aws s3 cp target/app.jar s3://your-bucket/.
  3. Deploy CloudFormation stack: aws cloudformation deploy --template-file template.yaml --stack-name ChurchStack --capabilities CAPABILITY_IAM.
  4. Find API Gateway URL and test with curl or Postman.

React Frontend: Hello World

Two options to serve React:

React fetch example calling API

fetch('https://{api}.execute-api.us-east-1.amazonaws.com/dev/hello', {
  method: 'POST',
  body: JSON.stringify('Manuela')
}).then(r => r.text()).then(console.log);

Local Development Workflow

Cost Management & Estimates

This architecture is designed to be cost-efficient. For small demo usage expect monthly costs near $0 — typically under $5 if used lightly.

AWS SDK Tasks You Can Implement

S3 (Storage)
Upload, download, list, delete files; generate presigned URLs for secure client uploads.
Aurora / RDS Data API
Execute SQL statements, create tables, run queries from Lambda using RdsDataClient.
DynamoDB (optional)
PutItem, GetItem, Query, Scan — useful as a low-cost alternative for simple schemas.
SNS / SQS
Publish notifications, decouple heavy tasks with queues, trigger asynchronous workers.
SES
Send transactional emails (welcome confirmations, alerts).
Secrets Manager / KMS
Store DB credentials; decrypt sensitive data; follow security best practices.
CloudFormation
Deploy stacks programmatically and manage updates.
CloudWatch
Push custom metrics, create alarms, and collect logs for observability.

Interview Tips & Demonstration Ideas