Skip to content

beyond-sw-camp/be13-1st-201Successful-Kppong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Kppong




๐ŸซกํŒ€์›์†Œ๊ฐœ

๐Ÿง‘โ€๐Ÿ’ป๊น€๋ฒ”์„ @g00dbyul ๐Ÿง‘โ€๐Ÿ’ป์†กํ˜„์ค€ @Hyeonjunnn ๐Ÿ‘ฉโ€๐Ÿ’ป์ด์ œ๊ฒฝ @jelee55 ๐Ÿง‘โ€๐Ÿ’ป์ด์ฐฝ์‹  @always0702



๐Ÿ“ฃ ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœ

์ง€๊ธˆ ์ด ์ˆœ๊ฐ„์—๋„ ํ•œ๋ฅ˜๋Š” ํผ์ ธ๋‚˜๊ฐ€ K-POP, K-FOOD ์—ดํ’์ด ๋Š์ด์ง€ ์•Š๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์— ๋ฐœ๋งž์ถ”์–ด ๋Œ€ํ•œ๋ฏผ๊ตญ์„ ์ฐพ๋Š” ์™ธ๊ตญ์ธ๋“ค๋„ ์ ์  ์ฆ๊ฐ€ํ•˜๋Š” ์ถ”์„ธ์ž…๋‹ˆ๋‹ค.

ํ˜„์žฌ ์—ฌ๋Ÿฌ ์—ฌํ–‰ ์ƒํ’ˆ ํ”Œ๋žซํผ๋“ค์ด ์กด์žฌํ•˜์ง€๋งŒ ๊ตญ๋‚ด ๊ด€๊ด‘๊ณผ ์ข€ ๋” ๋ฐ€์ ‘ํ•œ ํ”Œ๋žซํผ์„ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ์ฃผ ๋ชฉ์ ์ž…๋‹ˆ๋‹ค.

"Kppong"์€ ๊ตญ๋‚ด ๊ด€๊ด‘์— ์ตœ์ ํ™”๋œ ์นดํ…Œ๊ณ ๋ฆฌ, ์ฒดํ—˜ ํ”„๋กœ๊ทธ๋žจ์„ ์†Œ๊ฐœํ•˜๊ณ  ๋ฐฉํ•œํ•˜๋Š” ์™ธ๊ตญ์ธ๋“ค์—๊ฒŒ ์ฆ๊ฑฐ์šด ๊ฒฝํ—˜์ด ๋  ์ˆ˜ ์žˆ๋„๋กํ•˜๋Š” ์„ ํƒ์ง€๋ฅผ ๋Š˜๋ ค์ค๋‹ˆ๋‹ค.

๋˜ํ•œ ๊นจ๋—ํ•œ ์ปค๋ฎค๋‹ˆํ‹ฐ์™€ ์ง„์ •์„ฑ ์žˆ๋Š” ์•กํ‹ฐ๋น„ํ‹ฐ๋ฅผ ์œ„ํ•ด ๊ด€๋ฆฌ์ž๊ฐ€ ๊ด€๋ฆฌํ•˜๊ณ  ์†Œํ†ต ์ฐฝ๊ตฌ๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž ๊ฐ„์˜ ์˜์‚ฌ์†Œํ†ต์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  • ์‚ฌ์šฉ์ž๋Š” ๋งˆ์Œ์— ๋“œ๋Š” ํ”„๋กœ๊ทธ๋žจ์ด ์žˆ๋‹ค๋ฉด '์ฐœ'์ด๋ผ๋Š” ํ•ญ๋ชฉ์— ์ €์žฅํ•˜์—ฌ ์ถ”ํ›„์—๋„ ๊ด€์‹ฌ์žˆ๋Š” ํ”„๋กœ๊ทธ๋žจ์— ์‰ฝ๊ฒŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์‚ฌ์šฉ์ž๋Š” ๋งˆ์Œ์— ๋“œ๋Š” ํŒ๋งค์ž์—๊ฒŒ '์ฆ๊ฒจ์ฐพ๊ธฐ'๋กœ ๋“ฑ๋กํ•˜์—ฌ '์ฆ๊ฒจ์ฐพ๊ธฐ'๋กœ ํŒ๋งค์ž๋“ค์„ ๋ถ„๋ฅ˜ํ•˜๊ณ  ํŒ๋งค์ž๋“ค์˜ ๊ฒŒ์‹œ๋ฌผ์„ ๋น ๋ฅด๊ฒŒ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ํ”Œ๋žซํผ ๋‚ด์—์„œ ๋ถˆ๋Ÿ‰ํ•œ ๋‚ด์šฉ์„ ๊ฐ€์ง„ ํ”„๋กœ๊ทธ๋žจ์„ ์ œ๊ณตํ•˜๋Š” ํŒ๋งค์ž๋‚˜ ๊ฐ™์ด ์ฐธ์—ฌํ•˜๋Š” ์ž…์žฅ์—์„œ ๋ถˆํŽธ์„ ๋ผ์น˜๊ฑฐ๋‚˜ ํ•ด๋ฅผ ์ž…ํžˆ๋Š” ์‚ฌ์šฉ์ž์—๊ฒŒ ๊ฒฝ๊ณ ๋ฅผ ์ฃผ์–ด ์ผ์ • ์ด์ƒ ๊ฒฝ๊ณ ๊ฐ€ ๋ˆ„์ ๋  ๊ฒฝ์šฐ ํ”Œ๋žซํผ์—์„œ ํ‡ด์ถœ๋˜์–ด ๋‹ค์‹œ ์ ‘์†ํ•  ์ˆ˜ ์—†๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

  • ํ”Œ๋žซํผ ๋‚ด์— ๊ฒŒ์‹œํŒ์ด ์กด์žฌํ•˜์—ฌ ์‚ฌ์šฉ์ž๊ฐ€ ์ž์œ ๋กญ๊ฒŒ ๊ฒŒ์‹œ๋ฌผ์„ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ ๋Œ“๊ธ€์„ ํ†ตํ•ด ์„œ๋กœ ์†Œํ†ตํ•˜๋ฉฐ ์ •๋ณด ๊ณต์œ ๋‚˜ ํ›„๊ธฐ ๋“ฑ์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.




๐Ÿ“„ WBS

WBS




๐Ÿ” ๊ธฐ์ˆ ์Šคํƒ

Docker MariaDB

Prometheus Grafana

Git GitHub Discord




โ˜€๏ธ ์•„ํ‚คํ…์ฒ˜

์„ค๊ณ„์˜๋„

CQRS(Command Query Responsibility Segregation)

  • ๋ฐ์ดํ„ฐ์˜ ๋ช…๋ น(Command)๊ณผ ์กฐํšŒ(Query)๋ฅผ ๋ถ„๋ฆฌํ•˜๋Š” ์•„ํ‚คํ…์ฒ˜ ํŒจํ„ด
  • ๋ช…๋ น ์ž‘์—…๊ณผ ์กฐํšŒ ์ž‘์—…์„ ๋…๋ฆฝ์ ์œผ๋กœ ์ตœ์ ํ™” ๊ฐ€๋Šฅ

Master - Slave Replication

  • Proxysql์„ ํ†ตํ•ด ๋ช…๋ น ์ž‘์—…์€ Mater DB์— ์ ์šฉ, ์กฐํšŒ ์ž‘์—…์€ Slave DB์—์„œ ์กฐํšŒ
  • ๋ฐฑ์—… ๋ฐ ํŠธ๋ž˜ํ”ฝ ๋ถ„์‚ฐ ๊ฐ€๋Šฅ



๐Ÿ“‹ ์š”๊ตฌ์‚ฌํ•ญ ๋ช…์„ธ์„œ

์š”๊ตฌ์‚ฌํ•ญ ๋ช…์„ธ์„œ

์š”๊ตฌ์‚ฌํ•ญ ๋ช…์„ธ์„œ ์š”๊ตฌ์‚ฌํ•ญ ๋ช…์„ธ์„œ2




๐Ÿ“Œ ERD ๋‹ค์ด์–ด๊ทธ๋žจ

erdCloud




๐Ÿ“‘ ํ…Œ์ด๋ธ” ๋ช…์„ธ์„œ

ํ…Œ์ด๋ธ” ๋ช…์„ธ์„œ

์ฃผ์š” ํ…Œ์ด๋ธ”

์ฃผ๋ฌธ ํ…Œ์ด๋ธ”

์ฃผ๋ฌธ ํ…Œ์ด๋ธ” -> ์ฃผ๋ฌธ ์ƒํƒœ ์†์„ฑ์— ๋Œ€ํ•œ ์ฃผ์š” ๊ธฐ๋Šฅ

  • ์ฃผ๋ฌธ์ž ์ง„ํ–‰ ์ƒํƒœ์ธ ์ฃผ๋ฌธ์„ ์ทจ์†Œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
  • ์ฃผ๋ฌธ์ž๊ฐ€ ํ™•์ •, ์ทจ์†Œ ์ƒํƒœ์ธ ์ฃผ๋ฌธ์„ ์ทจ์†Œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค
  • ์ฃผ๋ฌธ์ž๊ฐ€ ์ง„ํ–‰ ์ƒํƒœ์ธ ์ฃผ๋ฌธ์„ ๊ฒฐ์ œํ•˜๋ฉด ํ™•์ •ํ•ฉ๋‹ˆ๋‹ค
  • ์ฃผ๋ฌธ์ž๊ฐ€ ํ™•์ •, ์ทจ์†Œ ์ƒํƒœ์ธ ์ฃผ๋ฌธ์„ ํ™•์ •ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค
์œ ์ € ํ…Œ์ด๋ธ”

์œ ์ € ํ…Œ์ด๋ธ” -> ์ฃผ์š” ๊ธฐ๋Šฅ

  • ์‹ ๊ณ  ๊ธฐ๋Šฅ ํ™œ์šฉ์„ ์œ„ํ•œ ์‹ ๊ณ  ์•„์ด๋”” ์†์„ฑ์„์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค
  • ์ œ์  ์—ฌ๋ถ€ ์†์„ฑ์„ ํ†ตํ•ด ์ดํ›„์—๋„ ์„œ๋น„์Šค์— ๊ฐ€์ž… ๋ถˆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค
์‹ ๊ณ  ํ…Œ์ด๋ธ”

์‹ ๊ณ  ํ…Œ์ด๋ธ” -> ์ฃผ์š” ๊ธฐ๋Šฅ

  • ์‚ฌ์šฉ์ž๋‚˜ ํŒจํ‚ค์ง€๋ฅผ ์‹ ๊ณ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค
  • ์‹ ๊ณ  ํ…Œ์ด๋ธ”์— ๋ฐ์ดํ„ฐ๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ์‚ฌ์šฉ์ž ๊ฒฝ๊ณ ๋ฅผ ๋ฐ›๊ฒŒ ๋ฉ๋‹ˆ๋‹ค
์‚ฌ์šฉ์ž ๊ฒฝ๊ณ  ํ…Œ์ด๋ธ”

์‚ฌ์šฉ์ž ๊ฒฝ๊ณ  ํ…Œ์ด๋ธ” -> ์ฃผ์š” ๊ธฐ๋Šฅ

  • ์‚ฌ์šฉ์ž์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ์Œ“์—ฌ 3๋ฒˆ ์ด์ƒ์ด ๋˜๋Š” ํšŒ์›์ด ๋ฐœ์ƒํ•˜๋ฉด ๊ทธ ํšŒ์›์€ ์‹œ์Šคํ…œ์˜ ์ ‘์†์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค



โœ‚๏ธ ํ”„๋กœ์‹œ์ € ๋ช…์„ธ์„œ

ํ”„๋กœ์‹œ์ € ๋ช…์„ธ์„œ



๐Ÿ’ป ํ…Œ์ŠคํŠธ ๋ช…์„ธ์„œ

ํ…Œ์ŠคํŠธ ๋ช…์„ธ์„œ

ํ…Œ์ŠคํŠธ ๋ช…์„ธ์„œ ํ…Œ์ŠคํŠธ ๋ช…์„ธ์„œ2




โœ๏ธ SQL

user
  • ํšŒ์›๊ฐ€์ž…
DELIMITER $$
CREATE OR REPLACE PROCEDURE insertUser(
    IN _userId VARCHAR(15),
       `_name` VARCHAR(15),
       _email VARCHAR(40),
       _passwd VARCHAR(40),
       _nickname VARCHAR(15),
       _phoneNum VARCHAR(15),
       _birthAt DATE,
       _national VARCHAR(15)
       )
BEGIN
    -- ํšŒ์› ์•„์ด๋”” ์ค‘๋ณต ๋ฐฉ์ง€ ์กฐ๊ฑด๋ฌธ
    DECLARE _cnt INT;
	SET _cnt = (SELECT COUNT(*) 
                FROM user 
                WHERE userId = _userId
                   OR email = _email
                   OR phoneNum = _phoneNum
                );

    IF (
        _cnt < 1 
    )THEN
            INSERT INTO user (
                userId,
                `name`,
                email,
                passwd,
                nickName,
                phoneNum,
                birthAt,
                national,
                updatedAt
                )
            VALUES (
                _userId,
                `_name`,
                _email,
                _passwd,
                _nickname,
                _phoneNum,
                _birthAt,
                _national,
                NULL
                )
            ;
    ELSE
        SELECT '์ด๋ฏธ ์กด์žฌํ•˜๋Š” ํšŒ์› ์ •๋ณด์ž…๋‹ˆ๋‹ค.';
            
    END IF;

END $$
DELIMITER ;
  • ๋กœ๊ทธ์ธ
DELIMITER $$
CREATE OR REPLACE PROCEDURE loginByUserId_passwd(
    IN _userId VARCHAR(15),
       _passwd VARCHAR(40)
    )
BEGIN

	DECLARE _cnt INT;
	SET _cnt = (SELECT COUNT(*) 
                FROM user 
                WHERE userId = _userId
      				AND passwd = _passwd
                );

    IF (
        _cnt >= 1 
    )
    THEN
    	SELECT '๋กœ๊ทธ์ธ ์„ฑ๊ณต';
    ELSE 
   	    SELECT '๋กœ๊ทธ์ธ ์‹คํŒจ';
    END IF;
END $$
DELIMITER ;
  • ๊ฐœ์ธ์ •๋ณด ์ˆ˜์ •
DELIMITER $$
CREATE OR REPLACE PROCEDURE updateOneUser_passwdByUserId(
    IN _userId VARCHAR(15),
       _passwd VARCHAR(40),
       _updatePasswd VARCHAR(40)
    )
BEGIN
    DECLARE _cnt INT;
	SET _cnt = (SELECT COUNT(*) 
                FROM user 
                WHERE userId = _userId
                  AND passwd = _passwd);

    IF (
        _cnt >= 1 
    )THEN
        UPDATE user 
        SET passwd = _updatePasswd
        WHERE (userId = _userId
          AND passwd = _passwd);
    ELSE
        SELECT '์•„์ด๋”” ๋˜๋Š” ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ํ™•์ธํ•ด์ฃผ์„ธ์š”' AS '์ธ์ฆ ์˜ค๋ฅ˜';
    END IF;

END $$
DELIMITER ;
package
  • ํŒจํ‚ค์ง€ ๋“ฑ๋ก

ํŒจํ‚ค์ง€ ๋“ฑ๋ก

  • ์กฐํšŒ

  • ๊ฒฐ๊ณผ๊ฐ’

๊ฒฐ๊ณผ๊ฐ’

order
  • ๋“ฑ๋ก

๋“ฑ๋ก

  • ์กฐํšŒ

์กฐํšŒ

  • ๊ฒฐ๊ณผ๊ฐ’

๊ฒฐ๊ณผ

  • ์—๋Ÿฌ(์ง„ํ–‰์ค‘์ธ ํŒจ๊ธฐ์ง€๊ฐ€ ์•„๋‹ˆ๋ฉด ๋ฐœ์ƒ)

์—๋Ÿฌ




About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published