Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DynamoDBを利用したKPI保存システム

gree_tech
February 04, 2016

 DynamoDBを利用したKPI保存システム

長谷川貴之(グリー株式会社)「DynamoDBを利用したKPI保存システム」

2016/01/25「Visualization Night#01」での登壇資料です
http://d-cube.connpass.com/event/25444/

gree_tech

February 04, 2016
Tweet

More Decks by gree_tech

Other Decks in Technology

Transcript

  1. ՄࢹԽγεςϜ • NativeGame KPIϨϙʔτ • ܾΊΒΕͨ਺஋ࢦඪͷΈදࣔ • ϓϩμΫτؒͷൺֱ͕༰қ • ϢʔβʔςΩετμογϡϘʔυ

    • ςΩετӾཡʹಛԽͨ͠γεςϜ • ϢʔβʔͷΞϯέʔτɼ໰͍߹ΘͤͳͲ͕ݟΕΔ • BIπʔϧ(Macaron) • ϓϩμΫτӡӦऀ͕ࣗ༝ʹ਺஋ࢦඪΛ࡞੒Ͱ͖Δ • εέδϡʔϦϯάͷػೳΛඋ͑Δ  (Ұ෦ͷγεςϜͷ঺հͰ͢)
  2. NativeGame KPIϨϙʔτ Rails + RDS(MySQL) + TD or Hadoop 

    Apache®, Apache Hadoop, Hadoop®(http://hadoop.apache.org/), and the yellow elephant logo are either registered trademarks or trademarks of the Apache Software Foundation(http://www.apache.org/) in the United States and/or other countries. Treasure Data Inc.(https://www.treasuredata.com/)
  3. ͦ΋ͦ΋OpenTSDBͬͯʁ • HBaseΛετϨʔδͱͨ࣌͠ܥྻσʔλϕʔε • Φʔϓϯιʔε • RRDToolͷΑ͏ʹ஋ΛؙΊͳ͍ • γεςϜͷϝτϦΫεͳͲେن໛σʔλ͕ಘҙ •

    ถYahoo!Ͱ͸15୆ͷαʔόʔͰຖඵ28ສ݅ͷWrite Λ͞͹͘ • http://www.slideshare.net/HBaseCon/ecosystem-session-6/6 
  4. OpenTSDBͷϝλσʔλ • DataPoints (time, value) • Metrics σόΠεผDAU • Tags

    device=fp, device=sp • Metrics + Tags = TimeSeries  ref. OpenTSDB HBaseCon http://opentsdb.net/misc/opentsdb-hbasecon.pdf
  5. AWSΛલఏͱͨ͠ϦϓϨΠεҊ • HBase on EMR • ৗ࣌Քಇ͓ͤͯ͘͞ͱίετ͕ߴ͍ • InfluxDB on

    EC2 • ݕূظ͕ؒͱΕͣӡ༻໘Ͱ৴པ͖͠Εͳ͔ͬͨ • MySQL(RDS) • ࣮੷͕͋Γɼ஋ஈ΋༧૝Ͱ͖Δ • DynamoDB • ৄ͘͠ͳ͍͕ɼσʔλ͸ιʔτͰ͖ΔΒ͍͠ 
  6. Unitফඅʹ͍ͭͯௐࠪ͢Δ • GemItem, BatchGetItem • ͲΜͳʹখ͍͞recordͰ΋ɼ1 record = 1 unit

    • 1೔1recordͩͱ͢Δͱɼ3೥෼औಘͰ1095unit • Query, Scan • ྦྷܭαΠζΛ࢖༻ͯ͠εϧʔϓοτΛܭࢉ • 1record = 1unitͰ͸ͳ͍ • 1record͕1KBͱ͢Δͱɼ3೥෼औಘͰ273unit 
  7. Unitফඅʹ͍ͭͯௐࠪ͢Δ • GemItem, BatchGetItem • ͲΜͳʹখ͍͞recordͰ΋ɼ1 record = 1 unit

    • 1೔1recordͩͱ͢Δͱɼ3೥෼औಘͰ1095unit • Query, Scan • ྦྷܭαΠζΛ࢖༻ͯ͠εϧʔϓοτΛܭࢉ • 1record = 1unitͰ͸ͳ͍ • 1record͕1KBͱ͢Δͱɼ3೥෼औಘͰ273unit  σʔλऔಘ͸QueryͳͷͰ҆৺
  8. ྫ) εϧʔϓοτΛมಈͤ͞Δ Ұఆʹอͬͨ৔߹ ऴ೔(read: 1000) • 0.00742 * 24 *

    30 * 1000 / 50 = $107 ಡΈࠐΈεϧʔϓοτΛมಈͤͨ͞৔߹ ฏ೔&೔த(read: 1000)ɼ໷ؒor౔೔(read: 500) • 0.00742 * 24 * 22 * (1000+500) / 2 / 50 = $59 • 0.00742 * 24 * 8 * 500 / 50 = $14 • $59 + $14 = $73  ͜ͷྫͰ͸ɼεϧʔϓοτͷมಈͰ32%Φϑʹʂ