Google Cloud Storage ์—ฐ๋™

๐Ÿšง

AWS S3 ์—ฐ๋™ ๊ธฐ๋Šฅ๊ณผ ๋ณธ์งˆ์ ์œผ๋กœ ๋™์ผํ•œ ๊ธฐ๋Šฅ์ด๋ฉฐ, Raw Data๋ฅผ Dumpํ•˜๋Š” ํƒ€๊ฒŸ์ด Google Cloud Storage ์ž…๋‹ˆ๋‹ค. Google Cloud Storage ์—ฐ๋™ ๊ธฐ๋Šฅ์€ ์—์–ด๋ธŒ๋ฆฟ์ง€ ๋Œ€์‹œ๋ณด๋“œ์—์„œ ์ง€์›ํ•˜๊ณ  ์žˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Google Cloud Storage ์—ฐ๋™์ด ํ•„์š”ํ•˜์‹  ๋ถ„๋“ค์€ ์•„๋ž˜ ๋ฌธ์„œ๋ฅผ ์ฝ๊ณ , ๋‹ด๋‹น CSM์—๊ฒŒ ์š”์ฒญ ๋ฉ”์ผ์„ ๋ณด๋‚ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

๋ชฉํ‘œ

Airbridge์—์„œ ์ œ๊ณตํ•˜๋Š” Raw Data(Tracking Link, Web, App)์„ Google Cloud Storage๋กœ ๋งค์ผ ๋คํ”„ ๋ฐ›์Šต๋‹ˆ๋‹ค.

๋ฐฉ๋ฒ•

1. GCP Service Accounts ๋งŒ๋“ค๊ธฐ

1-1) IAM > Service Accounts ๋ฉ”๋‰ด์— ๋“ค์–ด๊ฐ‘๋‹ˆ๋‹ค.

1-2) + Create Service Account๋ฅผ ๋ˆŒ๋Ÿฌ ์ƒˆ๋กœ์šด Service Account๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

1-3) ์ƒ์„ฑํ•œ Service Account์˜ ํ‚ค๋ฅผ ๋งŒ๋“ค๊ณ (Add Key), JSON ํ˜•์‹์œผ๋กœ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์Šต๋‹ˆ๋‹ค.

1788

2. Bucket ๋งŒ๋“ค๊ณ , ๊ถŒํ•œ ๋ถ€์—ฌํ•˜๊ธฐ

2-1) Storage Browser ๋ฉ”๋‰ด์—์„œ ์ƒˆ๋กœ์šด ๋ฒ„ํ‚ท(Create Bucket)์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

2-2) ์ƒ์„ฑํ•œ ๋ฒ„ํ‚ท์˜ Permissions ๋ฉ”๋‰ด์— ๋“ค์–ด๊ฐ€, + Grant Access ์ดํ›„ 1-3)์—์„œ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•˜๋˜ JSON ํŒŒ์ผ์— ๋“ค์–ด์žˆ๋Š” client_email์—๊ฒŒ Storage Object Admin ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•ฉ๋‹ˆ๋‹ค.

1164

3. Airbridge CSM์— ์—ฐ๋™ ์ •๋ณด ์ „๋‹ฌํ•˜๊ธฐ

์•„๋ž˜ 3๊ฐ€์ง€ ์ •๋ณด๋ฅผ CSM์—๊ฒŒ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.

  • 1-3)์—์„œ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•˜๋˜ JSON ํŒŒ์ผ ๋‚ด client_email
  • 1-3)์—์„œ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์•˜๋˜ JSON ํŒŒ์ผ ๋‚ด private_key
  • 2-1)์—์„œ ๋งŒ๋“ค์—ˆ๋˜ bucket ์ด๋ฆ„

์ฐธ๊ณ ์‚ฌํ•ญ

  • ๋ฐ์ดํ„ฐ ๋คํ”„๋Š” ์•„๋ž˜์˜ ๊ฒฝ๋กœ์— ๋ฉ๋‹ˆ๋‹ค.
    • ์›น ์ด๋ฒคํŠธ: {bucket_name}/{app_name}/web/{version}/date={YYYY-MM-DD}/
    • ์•ฑ ์ด๋ฒคํŠธ: {bucket_name}/{app_name}/app/{version}/date={YYYY-MM-DD}/
    • ํŠธ๋ž˜ํ‚น๋งํฌ ์ด๋ฒคํŠธ: {bucket_name}/{app_name}/tracking-link/{version}/date={YYYY-MM-DD}/
  • ์—ฐ๋™์ด ์™„๋ฃŒ๋œ ์ดํ›„์—๋Š” KST ๊ธฐ์ค€ ๋งค์ผ ์ƒˆ๋ฒฝ 4~6์‹œ ์‚ฌ์ด ๋คํ”„๋ฉ๋‹ˆ๋‹ค.
  • 128MB ํฌ๊ธฐ ์ดํ•˜์˜ ํŒŒ์ผ์ด ์—ฌ๋Ÿฌ๊ฐœ ๋คํ”„๋˜๋ฏ€๋กœ, ์—ฌ๋Ÿฌ๊ฐœ ํŒŒ์ผ์„ ๋กœ๋“œํ•˜๊ธฐ ์œ„ํ•œ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
  • Raw Data ์ปฌ๋Ÿผ ์ •๋ณด๋Š” https://abit.ly/dataspec ๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. ๋คํ”„ ๋ฒ„์ „์€ ์—ฐ๋™ ์š”์ฒญ ์‹œ์ ์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.(์š”์ฒญ ์‹œ์ ์˜ ์ตœ์‹  ๋ฒ„์ „์„ ๋คํ”„ํ•จ)
  • Google Cloud Storage Console์—์„œ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ์‹œ .csv.gz ํ™•์žฅ์ž์˜ ํŒŒ์ผ์ด .csv ํ™•์žฅ์ž๋กœ ์ „ํ™˜๋˜์–ด ๋‹ค์šด๋กœ๋“œ ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.(Console ๋ฒ„๊ทธ๋กœ ์ถ”์ •๋จ) ์ด ๊ฒฝ์šฐ .csv ํ™•์žฅ์ž๋ฅผ .csv.gz๋กœ ์ „ํ™˜ํ•ด์ค€ ๋’ค gunzip ๋“ฑ์˜ ๋ช…๋ น์–ด๋กœ gzip ์••์ถ•์„ ํ’€๋ฉด csv ํŒŒ์ผ์„ ํ™•์ธํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.