BE development plan

0ne·2024년 9월 22일

협업 방식

2명이서 각자 DB server와 Application server를 맡는게 좋을까?

  • BE developer database operation(queries, schema design) and the business logic layer (services, controllers) 모두를 다룰 줄 알아야 한다.
  • 병목현상 : debugging, testing, evolving application을 위해 database에 변경이 생길 때마다 기다려야 함

그럼? end-to-end ownership of features

modules, functionalities에 따라 분류해, 각각의 features마다 DBdesign + businessLogic + API development을 모두 다루도록 하기

DB server와 Application server로 분리

1st. Requirement Gathering and Planning

(both)

Output

Detailed requirement document and task assignment.

Detail task

• Clearly define the requirements for each feature.
• Break down the service into manageable modules (e.g., “Publisher Management,” “Book Management,” “Stock Management,” etc.).

• Assign features to each person. For example:

	•	Person 1: Handles Publisher Management and Book Inventory.
	•	Person 2: Handles Orders and Stock Management.
    

2nd. High-Level System Architecture Design

(both)

Output

Architecture diagram (data flow, service-to-service communication, etc.)

detailed task

• Design the overall architecture of the system, including the application server (Spring Boot) and database server (MySQL, PostgreSQL, etc.).

• Agree on a shared structure for your REST API design (e.g., /publishers, /books, /orders).


3rd. Database Design and Schema Definition

(Each Person for Their Feature)

Output

• ER Diagrams for your features.
• JPA entities with relationships and proper annotations (@OneToMany, @ManyToOne, etc.).

detailed task

• Each person will design the database schema for their feature(s). For example:

•	Person 1: Designs tables for Publisher, Book, and BookInventory.
•	Person 2: Designs tables for Order, Stock, and Return.

• Define the relationships (one-to-many, many-to-many) using JPA annotations in Spring Boot.
• Use tools like Flyway or Liquibase to manage migrations and keep the database schema consistent.

migration Tool의 사용


4th. JPA Entity Modeling

(Each Person for Their Feature)

Output

JPA entity classes for each feature.

Detailed task

• Create JPA entity classes that represent your database tables.

• Example for Person 1 (Publisher Management):

•	Publisher, Book, BookInventory entities.

• Example for Person 2 (Order Management):

•	Order, Stock, Return entities.

• Define relationships, constraints, and cascading operations where needed.


5th. Repository Layer

(Each Person for Their Feature)

Output

Repository classes to interact with the database.

Detailed task

• Create Spring Data JPA repositories for each entity.
• Use repositories to handle CRUD operations for the database.
• Example for Person 1

        •	PublisherRepository, BookRepository.

• Example for Person 2:

•	OrderRepository, StockRepository.

• Implement custom queries for complex retrievals using @Query annotations or JPA method conventions.


6th. Service Layer Implemetation

(Each Person for Their Feature)

output

Service classes that contain all the business logic.

detailed task

• Implement the service classes that contain the business logic for your assigned features.
• Example for Person 1:

•	PublisherService: Logic for adding, editing, and retrieving publishers.
•	BookInventoryService: Logic for managing book stock and availability.

• Example for Person 2:

•	OrderService: Logic for processing orders, handling returns, and updating stock.
•	StockService: Logic for adjusting stock levels and validating transactions.

• Use @Transactional to manage transactions where multiple database operations need to happen atomically.


7th. REST API Development

(Each Person for Their Feature)

output

REST API endpoints for each feature.

detailed task

• Implement controllers to expose the business logic via RESTful APIs.
• Example for Person 1:

  • Create endpoints like /publishers, /books, /inventory.
  • Example:
    - GET /publishers to list all publishers.
    - POST /books to add a new book.
    • Example for Person 2:
  • Create endpoints like /orders, /stock, /returns.
  • Example:
    - POST /orders to place a new order.
    - GET /orders/{id} to get order details.
    • Ensure you handle validation, error handling, and responses in a standardized way (e.g., returning HTTP status codes and proper error messages).

8th. Security and Authentication

(Both)

output

Secured APIs with user authentication and role-based access.

detailed task

• Implement security using Spring Security to protect sensitive endpoints.
• Define roles and permissions (e.g., admin vs regular users).
• Use JWT tokens or OAuth for user authentication.
• Secure routes like /inventory, /orders with proper role-based access control.


9th. Testing

(Each Person for Their Feature)

output

A suite of tests to ensure both database interactions and APIs work as expected.

detailed task

• Write unit tests for your service layer to ensure business logic is working correctly.
• Write integration tests for your REST APIs to ensure they respond correctly to requests.
• Use JUnit, Mockito, and Spring Boot's testing features for this.


10th. Database and Application Server Setup

(Both)

output

Fully functional database and application servers, ready for use.

detailed task

• Set up the database server (MySQL, PostgreSQL) on a cloud platform or local environment.
• Set up the Spring Boot application server.
• Configure database connections in application.properties or application.yml.


11th. CI/CD and Deployment

(Both)

output

Deployed application with automated testing and deployment processes.

detailed task

• Use Docker to containerize both the application and database servers for consistent deployment.
• Set up a CI/CD pipeline (e.g., GitHub Actions, Jenkins, GitLab CI) to automate testing and deployment.
• Deploy the application to a cloud platform (AWS, Azure, GCP) or use a container orchestration tool like Kubernetes.


12th. Final Integration and Optimization

(Both)

output

Finalized and optimized backend ready for production.

detailed task

• Integrate all features and ensure that they work together smoothly.
• Perform load testing to ensure that the application can handle the expected number of users.
• Optimize performance for any database queries that are slow or APIs that are inefficient.

profile
@Hanyang univ(seoul). CSE

0개의 댓글