shape

Dodam - Building the Project-Based Late-Night Self-Study Application Feature

Overview

Extending Dodam's late-night self-study feature and optimizing queries

Tech Stack

  • Java

    Java

  • Spring Boot

    Spring Boot

  • Spring JPA

    Spring JPA

  • MySQL

    MySQL

  • Redis

    Redis

  • Docker Compose

    Docker Compose

  • AWS

    AWS

  • GitHub Actions

    GitHub Actions

  • Git

    Git

Team

9 members (2 Backend, 3 Web, 2 Android, 2 iOS)

Period

2025.04 ~ 2025.05

Links

Implementation CodeWeb Service

Details

  1. My Contributions
    • Implemented project-based late-night self-study applications. A student enters the date, time, and project details, selects team members, and submits the application.
    • When a student applies or a teacher changes the status (accept/reject), the application status of all participants, including the project leader, had to be updated together.
  2. Initial Table Structure
    • An individual late-night self-study feature already existed. During MVP development, we reused the existing general late-night self-study table and created a separate project table that stored the project ID as a foreign key.
    Initial Table Structure 1
    Initial Table Structure 2
  3. Problems
    • Unnecessary WHERE clauses were generated when querying projects. Whenever JPA looked up self-study records, it had to distinguish the self-study type by the presence of project_id, which added redundant WHERE conditions to every request.
    • Frequent loops and repeated SQL queries led to the JPA N+1 problem and high time complexity.
  4. Improved Table Structure
    • Normalized the schema into night_study, night_study_project, and night_study_project_member tables.
    • Rather than relying on loops, I reduced time complexity by using IN, JOIN, and EXISTS in JPA and JPQL.
    Improved Table Structure 1
    Improved Table Structure 2
    Improved Table Structure 3
  5. Results
    • Reduced response times from an average of 320ms to 87ms for POST requests and from 624ms to 49ms for PATCH requests.
    • Eliminated the unnecessary queries (JOINs, WHERE clauses, etc.) that had been generated when querying projects.
  6. Before Refactoring
      Before Refactoring 1
      Before Refactoring 2
      Before Refactoring 3
    • After Refactoring
        After Refactoring 1
        After Refactoring 2
        After Refactoring 3