SlideShare a Scribd company logo
1 of 58
The Trial and Error in 
Releasing GREE Chat 
Shun Ozaki, Takayuki Hasegawa 
Copyright © GREE, Inc. All Rights Reserved. 
Scala Matsuri2014 B-6 
GREE's First Scala Product
Copyright © GREE, Inc. All Rights Reserved. 
Self Introduction 
• Shun Ozaki 
• @wozaki 
• Joined in April, 2013 
• Android Application 
• Takayuki Hasegawa 
• @hase1031 
• Joined in April, 2013 
• NLP, Machine Learning 
1/56
Copyright © GREE, Inc. All Rights Reserved. 
GREE Chat 
• Released at June 2 
2/56
How to build our system for hundreds of 
thousands daily users 
Copyright © GREE, Inc. All Rights Reserved. 
Agenda 
3/56
Goal 
Share our knowledge we got through 
the development of GREE Chat 
Copyright © GREE, Inc. All Rights Reserved. 
• Why Scala? 
• Team development 
• Decision of frameworks 
• Obstacles & workarounds 
4/56
Copyright © GREE, Inc. All Rights Reserved. 
Outline 
• Reason of Selecting Scala 
• Learning Scala in a Team 
• Architecture of GREE Chat 
• Obstacles 
• Summary
• Reason of Selecting Scala 
• Learning Scala in a Team 
• Architecture of GREE Chat 
• Obstacles 
• Summary 
Copyright © GREE, Inc. All Rights Reserved. 
Outline
Decide the Language 
based on the Requirement 
Copyright © GREE, Inc. All Rights Reserved.
Requirements 
• Hundreds of thousands daily users 
• Real-time response 
Copyright © GREE, Inc. All Rights Reserved. 
 Connect with streaming 
• Run on a small number of servers 
 Utilize server resource effectively 
• Maintain for over 5 years 
8/56
Copyright © GREE, Inc. All Rights Reserved. 
◎ GREE uses PHP so heavily 
• Many libraries and know-how in GREE 
△ Streaming 
• #connections = #processes 
△ Single thread, multi process 
• Overhead of spawning an OS process 
△ Maintainability 
• Dynamic typing 
9/56
◎Compatible with concurrent programming 
◎One process, many connections 
◎High maintainability 
• Static typing 
• Functional programming (no side effects) 
◎Stimulate new technology learning in GREE 
• Open to new languages & technologies! 
Copyright © GREE, Inc. All Rights Reserved. 
Scala! 
10/56
• Reason of Selecting Scala 
• Learning Scala in a Team 
• Architecture of GREE Chat 
• Obstacles 
• Summary 
Copyright © GREE, Inc. All Rights Reserved. 
Outline
After adopting Scala … 
Copyright © GREE, Inc. All Rights Reserved.
Only two Scala programmers in a team of seven 
Copyright © GREE, Inc. All Rights Reserved. 
Shortage of Scala experts 
2/ 
7 
13/56
Only two Scala programmers in a team of seven 
We must build up our skill! 
Copyright © GREE, Inc. All Rights Reserved. 
Shortage of Scala experts 
2/ 
7 
14/56
Copyright © GREE, Inc. All Rights Reserved. 
Learning of Scala 
1. Self study 
2. Study club 
3. Pair programming 
15/56
Copyright © GREE, Inc. All Rights Reserved. 
1. Self Study 
Understand the basic syntax
Copyright © GREE, Inc. All Rights Reserved. 
1. Self Study 
Books 
17/56
Copyright © GREE, Inc. All Rights Reserved. 
1. Self Study 
Documents by Twitter 
https://twitter.github.io/scala_school/ http://twitter.github.io/effectivescala/ 18/56
Copyright © GREE, Inc. All Rights Reserved. 
1. Self Study 
Source code from OSS 
19/56
Copyright © GREE, Inc. All Rights Reserved. 
2. Study Club 
Share what we learned by ourselves 
Introduction to functional programming
2. Study Club 
• Each engineer solves the problems 
provided by Scala experts 
Copyright © GREE, Inc. All Rights Reserved. 
• e.g., Binary Tree, Fibonacci Sequence 
21/56
• Example of factorial generation algorithm 
Copyright © GREE, Inc. All Rights Reserved. 
2. Study Club 
Discussion with Members 
Use var Use recursion 
22/56
• Example of factorial generation algorithm 
Use var Use recursion 
Copyright © GREE, Inc. All Rights Reserved. 
2. Study Club 
Discussion with Members 
No side effect 
23/56
3. Pair Programming 
Practice by using the knowledge 
Copyright © GREE, Inc. All Rights Reserved. 
obtained from study club
Copyright © GREE, Inc. All Rights Reserved. 
3. Pair Programming 
• Effective learning 
• Learn about symbols (e.g., +, @), which cannot 
be searched easily on the Internet 
• Supplement the knowledge not taught at 
study club 
• Complex syntaxes (e.g., implicit, currying) 
• Development tools (e.g., sbt, IntelliJ) 
25/56
Copyright © GREE, Inc. All Rights Reserved. 
Summary: Adopting Scala 
• Reasons of selecting Scala 
• Compatible with concurrent programming 
• Maintainability because of static typing 
• Learning of Scala 
• Self Study, Study Club, Pair Programming 
• Big burdens on Scala experts 
• Needed for teaching team members 
• Maintain the quality of codes 
26/56
• Reason of Selecting Scala 
• Learning Scala in a Team 
• Architecture of GREE Chat 
• Obstacles 
• Summary 
Copyright © GREE, Inc. All Rights Reserved. 
Outline
Architecture of Backend (simplified) 
Copyright © GREE, Inc. All Rights Reserved. 
• Servers separated by Queues 
• API Server: Process users’ requests 
• EventBus Server: Process events in Queue 
• Stream Server: Supply event to connected users 
28/56
Role of Each Server 
Copyright © GREE, Inc. All Rights Reserved. 
and Framework
Copyright © GREE, Inc. All Rights Reserved. 
API Server 
Process users’ requests 
• Enqueue events 
• e.g., Send message 
Join/leave conversation 
• Techniques to process a lot of requests 
• Delegate heavy tasks (e.g., Disk I/O) to others 
• Logic is written to run asynchronously 
• scala.concurrent.Future 
30/56
• RPC system for JVM based on Netty 
• Support us to write asynchronous logic 
Copyright © GREE, Inc. All Rights Reserved. 
• Used by large scale web services 
• e.g., Twitter, Tumblr, Foursquare, Pinterest 
• Equipped with various clients 
• Redis, Memcached 
• With retry policy, connection pools 
31/56
Copyright © GREE, Inc. All Rights Reserved. 
EventBus Server 
Process events in Queue 
• Examples of tasks 
• Logging 
• Inquire GREE internal system 
• Store events in DB 
• etc. 
• Problems of concurrent processing 
• Deadlock, race condition, … 
32/56
Framework to write concurrent, distributed 
logic more easily 
• No need to handle shared resources 
Copyright © GREE, Inc. All Rights Reserved. 
• Race condition, dead-lock 
• Logic separation 
• Parent-Child 
• Fault tolerance 
33/56
Copyright © GREE, Inc. All Rights Reserved. 
Example of Akka 
34/56
Copyright © GREE, Inc. All Rights Reserved. 
Example of Akka 
Match by Event type 
35/56
Copyright © GREE, Inc. All Rights Reserved. 
Example of Akka 
Send copy to child 
36/56
Copyright © GREE, Inc. All Rights Reserved. 
Example of Akka 
log 
37/56
Copyright © GREE, Inc. All Rights Reserved. 
Stream Server 
Supply events to connected users 
• Connect by streaming 
• Increase connections as much as possible 
• Keep users data in the memory to reduce I/O 
• Asynchronous I/O by Finagle, Akka 
• Task division by Akka 
• Supply events to users 
• Update users data 
• Send KeepAlive to users 
38/56
Copyright © GREE, Inc. All Rights Reserved. 
Summary: Architecture 
• Each server is separated by Queue 
• API, EventBus, Stream Server 
• Framework is selected by considering 
asynchronous processing 
• Finagle, Akka 
• Task is divided by Akka 
• Easy to write concurrent logic 
39/56
Copyright © GREE, Inc. All Rights Reserved. 
Outline 
• Reason of Selecting Scala 
• Learning Scala in a Team 
• Architecture of GREE Chat 
• Obstacles 
• Summary
Copyright © GREE, Inc. All Rights Reserved. 
Obstacles 
1.JVM 
• Full GC 
2. Self-created Scala library 
• Sharding 
• ID Architecture 
41/56
Full GC 
Problems 
Copyright © GREE, Inc. All Rights Reserved.
• Scala runs on JVM 
• We want to prevent “stop the world” 
• GC in young generation is faster than full GC 
• Try not to let it store object in old generation 
Copyright © GREE, Inc. All Rights Reserved. 
Full GC 
Young generation Old generation 
43/56
Copyright © GREE, Inc. All Rights Reserved. 
Causes of Uncollected 
Reference Problem 
• Use method that has side effects 
• Reuse object everywhere 
• Forget to release used resources 
44/56
Copyright © GREE, Inc. All Rights Reserved. 
Causes of Uncollected 
Reference Problem 
• Use method that has side effects 
• Reuse object everywhere 
• Forget to release used resources 
Difficult to recognize by developers 
45/56
Copyright © GREE, Inc. All Rights Reserved. 
Short-Lived Object 
• Use val variable (final variable) 
• Don’t use mutable variable 
• Don’t leave references to objects for too long 
Create new objects instead of updating old ones 
46/56
Sharding: Scalable Storage 
47/56 
Copyright © GREE, Inc. All Rights Reserved.
Copyright © GREE, Inc. All Rights Reserved. 
Scale up? 
48/56
Copyright © GREE, Inc. All Rights Reserved. 
Scale out! 
49/56
Copyright © GREE, Inc. All Rights Reserved. 
Horizontal Partitioning 
• Sharding is necessary! 
• Considering capacity and #accesses 
• We have Cascade, a sharding library 
• For PHP, not Scala 
• So, we created Aurora and make it OSS 
• Aurora and application were developed 
simultaneously 
• So difficult to integrate them during 
development 
• Code modification must be done in many parts 
50/56
ID Architecture: 
UUID and InnoDB 
Ref:MySQL InnoDB Primary Key Choice: GUID/UUID vs Integer Insert Performance 
http://kccoder.com/mysql/uuid-vs-int-insert-performance/ 
Copyright © GREE, Inc. All Rights Reserved.
Ref:MySQL InnoDB Primary Key Choice: GUID/UUID vs Integer Insert Performance 
http://kccoder.com/mysql/uuid-vs-int-insert-performance/ 
Copyright © GREE, Inc. All Rights Reserved. 
UUID 
AUTO_INCREMENT #record 
#time
Drop UUID, Take Time-Based 
• At first, we used UUID as primary key 
• But this caused MySQL to insert randomly 
• Created a library to generate ID instead 
• Referred to Snowflake by Twitter 
• Sequential insertion based on sorted created 
time 
53/56 
Copyright © GREE, Inc. All Rights Reserved.
Copyright © GREE, Inc. All Rights Reserved. 
Summary: Obstacles & 
Workaround 
• JVM 
• Use short-lived objects to avoid Full GC 
• Self-created Scala library 
• Sharding 
• Made Scala library OSS 
• Integration of library to application was difficult 
• ID Architecture 
• Adopt time-based ID for sequential insertion 
54/56
Copyright © GREE, Inc. All Rights Reserved. 
Outline 
• Reason of Selecting Scala 
• Learning Scala in a Team 
• Architecture of GREE Chat 
• Obstacles 
• Summary
Copyright © GREE, Inc. All Rights Reserved. 
Summary 
• Reasons for selecting Scala 
• Compatible with concurrent programming 
• Plan Scala learning within the team 
• Learning cost is expensive 
• Architecture & Frameworks 
• Each server is separated by Queue 
• Finagle, Akka 
• Shortage of libraries 
• We must have made libraries by ourselves 
• Needed to pull request to OSS repository 
56/56
Copyright © GREE, Inc. All Rights Reserved. 
Thanks! 
@tomoyoshi_ogura, @kyo_ago, @takc923 
@yoshie_777, @le_chang, @beketa, @j5ik2o 
and 
ScalaMatsuri staffs

More Related Content

What's hot

deep learning in production cff 2017
deep learning in production cff 2017deep learning in production cff 2017
deep learning in production cff 2017Ari Kamlani
 
Apache Spark: Usage and Roadmap in Hadoop
Apache Spark: Usage and Roadmap in HadoopApache Spark: Usage and Roadmap in Hadoop
Apache Spark: Usage and Roadmap in HadoopCloudera Japan
 
Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1Wolfgang Weigend
 
The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)Simon Haslam
 
What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?Tim Ellison
 
The do's and don'ts with java 9 (Devoxx 2017)
The do's and don'ts with java 9 (Devoxx 2017)The do's and don'ts with java 9 (Devoxx 2017)
The do's and don'ts with java 9 (Devoxx 2017)Robert Scholte
 
Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database gvenzl
 
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARN
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARNHadoop {Submarine} Project: Running Deep Learning Workloads on YARN
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARNDataWorks Summit
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsPetr Jiricka
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Konstantin Gredeskoul
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin ProgrammingAtlassian
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performancegvenzl
 
Apache Spark Operations
Apache Spark OperationsApache Spark Operations
Apache Spark OperationsCloudera, Inc.
 
Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介gree_tech
 
Java 9 Functionality and Tooling
Java 9 Functionality and ToolingJava 9 Functionality and Tooling
Java 9 Functionality and ToolingTrisha Gee
 
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarWicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarKamesh Pemmaraju
 
Rich Archbold, Senior Director of Engineering, Intercom - Run less software
Rich Archbold,  Senior Director of Engineering, Intercom - Run less softwareRich Archbold,  Senior Director of Engineering, Intercom - Run less software
Rich Archbold, Senior Director of Engineering, Intercom - Run less softwareTechsylvania
 
Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013
Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013
Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013Amazon Web Services
 

What's hot (20)

deep learning in production cff 2017
deep learning in production cff 2017deep learning in production cff 2017
deep learning in production cff 2017
 
Apache Spark: Usage and Roadmap in Hadoop
Apache Spark: Usage and Roadmap in HadoopApache Spark: Usage and Roadmap in Hadoop
Apache Spark: Usage and Roadmap in Hadoop
 
Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1Development with JavaFX 9 in JDK 9.0.1
Development with JavaFX 9 in JDK 9.0.1
 
The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)The Kubernetes WebLogic revival (part 2)
The Kubernetes WebLogic revival (part 2)
 
What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?What's New in IBM Java 8 SE?
What's New in IBM Java 8 SE?
 
The do's and don'ts with java 9 (Devoxx 2017)
The do's and don'ts with java 9 (Devoxx 2017)The do's and don'ts with java 9 (Devoxx 2017)
The do's and don'ts with java 9 (Devoxx 2017)
 
Dockerizing Oracle Database
Dockerizing Oracle Database Dockerizing Oracle Database
Dockerizing Oracle Database
 
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARN
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARNHadoop {Submarine} Project: Running Deep Learning Workloads on YARN
Hadoop {Submarine} Project: Running Deep Learning Workloads on YARN
 
Cloud Native Java:GraalVM
Cloud Native Java:GraalVMCloud Native Java:GraalVM
Cloud Native Java:GraalVM
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.js
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
 
Supercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database PerformanceSupercharge your Code to get optimal Database Performance
Supercharge your Code to get optimal Database Performance
 
Apache Spark Operations
Apache Spark OperationsApache Spark Operations
Apache Spark Operations
 
Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介
 
Java 9 Functionality and Tooling
Java 9 Functionality and ToolingJava 9 Functionality and Tooling
Java 9 Functionality and Tooling
 
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with CrowbarWicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
Wicked Easy Ceph Block Storage & OpenStack Deployment with Crowbar
 
Splunk Java Agent
Splunk Java AgentSplunk Java Agent
Splunk Java Agent
 
Rich Archbold, Senior Director of Engineering, Intercom - Run less software
Rich Archbold,  Senior Director of Engineering, Intercom - Run less softwareRich Archbold,  Senior Director of Engineering, Intercom - Run less software
Rich Archbold, Senior Director of Engineering, Intercom - Run less software
 
Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013
Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013
Cloud Connected Devices on a Global Scale (CPN303) | AWS re:Invent 2013
 

Viewers also liked

Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論scalaconfjp
 
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!scalaconfjp
 
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)TIS Inc.
 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scalatakezoe
 
sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策scalaconfjp
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scalatod esking
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoTaro L. Saito
 
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一scalaconfjp
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
 
Scala@SmartNews AdFrontend を Scala で書いた話
Scala@SmartNews AdFrontend を Scala で書いた話Scala@SmartNews AdFrontend を Scala で書いた話
Scala@SmartNews AdFrontend を Scala で書いた話Keiji Muraishi
 
Scalaの現状と今後
Scalaの現状と今後Scalaの現状と今後
Scalaの現状と今後Kota Mizushima
 
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜scalaconfjp
 
Scala が支える医療系ウェブサービス #jissenscala
Scala が支える医療系ウェブサービス #jissenscalaScala が支える医療系ウェブサービス #jissenscala
Scala が支える医療系ウェブサービス #jissenscalaKazuhiro Sera
 
Scala@SmartNews_20150221
Scala@SmartNews_20150221Scala@SmartNews_20150221
Scala@SmartNews_20150221Shigekazu Takei
 
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalaビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalatakezoe
 
オウンドメディアのコンテンツ事例集40選(サムライト)
オウンドメディアのコンテンツ事例集40選(サムライト)オウンドメディアのコンテンツ事例集40選(サムライト)
オウンドメディアのコンテンツ事例集40選(サムライト)サムライト株式会社
 

Viewers also liked (20)

Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
 
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
 
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scala
 
sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scala
 
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
 
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
Scala@SmartNews AdFrontend を Scala で書いた話
Scala@SmartNews AdFrontend を Scala で書いた話Scala@SmartNews AdFrontend を Scala で書いた話
Scala@SmartNews AdFrontend を Scala で書いた話
 
Scalaの現状と今後
Scalaの現状と今後Scalaの現状と今後
Scalaの現状と今後
 
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
 
Scala が支える医療系ウェブサービス #jissenscala
Scala が支える医療系ウェブサービス #jissenscalaScala が支える医療系ウェブサービス #jissenscala
Scala が支える医療系ウェブサービス #jissenscala
 
Scala@SmartNews_20150221
Scala@SmartNews_20150221Scala@SmartNews_20150221
Scala@SmartNews_20150221
 
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalaビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
 
オウンドメディアのコンテンツ事例集40選(サムライト)
オウンドメディアのコンテンツ事例集40選(サムライト)オウンドメディアのコンテンツ事例集40選(サムライト)
オウンドメディアのコンテンツ事例集40選(サムライト)
 

Similar to [ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫

Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Curity
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...David Buck
 
Oracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlOracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlChris Muir
 
PySpark Best Practices
PySpark Best PracticesPySpark Best Practices
PySpark Best PracticesCloudera, Inc.
 
Shrinking the container_zurich_july_2018
Shrinking the container_zurich_july_2018Shrinking the container_zurich_july_2018
Shrinking the container_zurich_july_2018Ewan Slater
 
Building Effective Near-Real-Time Analytics with Spark Streaming and Kudu
Building Effective Near-Real-Time Analytics with Spark Streaming and KuduBuilding Effective Near-Real-Time Analytics with Spark Streaming and Kudu
Building Effective Near-Real-Time Analytics with Spark Streaming and KuduJeremy Beard
 
Troubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingTroubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingGreat Wide Open
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...Chris Muir
 
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMOSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMmfrancis
 
BYOP: Custom Processor Development with Apache NiFi
BYOP: Custom Processor Development with Apache NiFiBYOP: Custom Processor Development with Apache NiFi
BYOP: Custom Processor Development with Apache NiFiDataWorks Summit
 
Bringing Java into the Open
Bringing Java into the Open Bringing Java into the Open
Bringing Java into the Open Heather VanCura
 
Building Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache SparkBuilding Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache SparkJeremy Beard
 
Dev ops in the cloud use case and best practices meetup
Dev ops in the cloud use case and best practices   meetupDev ops in the cloud use case and best practices   meetup
Dev ops in the cloud use case and best practices meetupNitu Parimi
 
Building a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with ImpalaBuilding a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with ImpalaSwiss Big Data User Group
 
Building a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with ImpalaBuilding a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with Impalahuguk
 
Lambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale MLLambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale MLhuguk
 

Similar to [ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫 (20)

Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1Java and Serverless - A Match Made In Heaven, Part 1
Java and Serverless - A Match Made In Heaven, Part 1
 
YARN
YARNYARN
YARN
 
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
 
Oracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlOracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version Control
 
PySpark Best Practices
PySpark Best PracticesPySpark Best Practices
PySpark Best Practices
 
Shrinking the container_zurich_july_2018
Shrinking the container_zurich_july_2018Shrinking the container_zurich_july_2018
Shrinking the container_zurich_july_2018
 
Building Effective Near-Real-Time Analytics with Spark Streaming and Kudu
Building Effective Near-Real-Time Analytics with Spark Streaming and KuduBuilding Effective Near-Real-Time Analytics with Spark Streaming and Kudu
Building Effective Near-Real-Time Analytics with Spark Streaming and Kudu
 
Troubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed DebuggingTroubleshooting Hadoop: Distributed Debugging
Troubleshooting Hadoop: Distributed Debugging
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...Oracle ADF Architecture TV -  Planning & Getting Started - Team, Skills and D...
Oracle ADF Architecture TV - Planning & Getting Started - Team, Skills and D...
 
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBMOSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
OSGi Technology, Eclipse and Convergence - Jeff McAffer, IBM
 
BYOP: Custom Processor Development with Apache NiFi
BYOP: Custom Processor Development with Apache NiFiBYOP: Custom Processor Development with Apache NiFi
BYOP: Custom Processor Development with Apache NiFi
 
Bringing Java into the Open
Bringing Java into the Open Bringing Java into the Open
Bringing Java into the Open
 
Building Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache SparkBuilding Efficient Pipelines in Apache Spark
Building Efficient Pipelines in Apache Spark
 
Serverless Kotlin
Serverless KotlinServerless Kotlin
Serverless Kotlin
 
Dev ops in the cloud use case and best practices meetup
Dev ops in the cloud use case and best practices   meetupDev ops in the cloud use case and best practices   meetup
Dev ops in the cloud use case and best practices meetup
 
Building a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with ImpalaBuilding a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with Impala
 
APAC Tour 2019 update
APAC Tour 2019 updateAPAC Tour 2019 update
APAC Tour 2019 update
 
Building a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with ImpalaBuilding a Hadoop Data Warehouse with Impala
Building a Hadoop Data Warehouse with Impala
 
Lambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale MLLambda architecture on Spark, Kafka for real-time large scale ML
Lambda architecture on Spark, Kafka for real-time large scale ML
 

More from gree_tech

アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜gree_tech
 
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介gree_tech
 
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表gree_tech
 
アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~gree_tech
 
長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化gree_tech
 
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介gree_tech
 
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現についてSINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現についてgree_tech
 
海外展開と負荷試験
海外展開と負荷試験海外展開と負荷試験
海外展開と負荷試験gree_tech
 
翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組み翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組みgree_tech
 
組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違い組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違いgree_tech
 
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介gree_tech
 
データエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件についてデータエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件についてgree_tech
 
シェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジーシェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジーgree_tech
 
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-gree_tech
 
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話gree_tech
 
比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)gree_tech
 
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行gree_tech
 
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜gree_tech
 
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)gree_tech
 
基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-
基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-
基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-gree_tech
 

More from gree_tech (20)

アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
アナザーエデンPC版リリースへの道のり 〜WFSにおけるマルチプラットフォーム対応の取り組み〜
 
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
GREE VR Studio Laboratory「XR-UX Devプロジェクト」の成果紹介
 
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
REALITYアバターを様々なメタバースで活躍させてみた - GREE VR Studio Laboratory インターン研究成果発表
 
アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~アプリ起動時間高速化 ~推測するな、計測せよ~
アプリ起動時間高速化 ~推測するな、計測せよ~
 
長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化長寿なゲーム事業におけるアプリビルドの効率化
長寿なゲーム事業におけるアプリビルドの効率化
 
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
WFSにおけるCloud SpannerとGKEを中心としたGCP導入事例の紹介
 
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現についてSINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
SINoALICE -シノアリス- Google Cloud Firestoreを用いた観戦機能の実現について
 
海外展開と負荷試験
海外展開と負荷試験海外展開と負荷試験
海外展開と負荷試験
 
翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組み翻訳QAでのテスト自動化の取り組み
翻訳QAでのテスト自動化の取り組み
 
組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違い組み込み開発のテストとゲーム開発のテストの違い
組み込み開発のテストとゲーム開発のテストの違い
 
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介サーバーフレームワークに潜んでる脆弱性検知ツール紹介
サーバーフレームワークに潜んでる脆弱性検知ツール紹介
 
データエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件についてデータエンジニアとアナリストチーム兼務になった件について
データエンジニアとアナリストチーム兼務になった件について
 
シェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジーシェアドサービスとしてのデータテクノロジー
シェアドサービスとしてのデータテクノロジー
 
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
「ドキュメント見つからない問題」をなんとかしたい - 横断検索エンジン導入の取り組みについて-
 
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
「Atomic Design × Nuxt.js」コンポーネント毎に責務の範囲を明確にしたら幸せになった話
 
比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)比較サイトの検索改善(SPA から SSR に変換)
比較サイトの検索改善(SPA から SSR に変換)
 
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
コードの自動修正によって実現する、機能開発を止めないフレームワーク移行
 
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
「やんちゃ、足りてる?」〜ヤンマガWebで挑戦を続ける新入りエンジニア〜
 
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
法人向けメタバースプラットフォームの開発の裏側をのぞいてみた(仮)
 
基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-
基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-
基調講演 -グリーが目指すエンジニアのあり方、チームのあり方-
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫

  • 1. The Trial and Error in Releasing GREE Chat Shun Ozaki, Takayuki Hasegawa Copyright © GREE, Inc. All Rights Reserved. Scala Matsuri2014 B-6 GREE's First Scala Product
  • 2. Copyright © GREE, Inc. All Rights Reserved. Self Introduction • Shun Ozaki • @wozaki • Joined in April, 2013 • Android Application • Takayuki Hasegawa • @hase1031 • Joined in April, 2013 • NLP, Machine Learning 1/56
  • 3. Copyright © GREE, Inc. All Rights Reserved. GREE Chat • Released at June 2 2/56
  • 4. How to build our system for hundreds of thousands daily users Copyright © GREE, Inc. All Rights Reserved. Agenda 3/56
  • 5. Goal Share our knowledge we got through the development of GREE Chat Copyright © GREE, Inc. All Rights Reserved. • Why Scala? • Team development • Decision of frameworks • Obstacles & workarounds 4/56
  • 6. Copyright © GREE, Inc. All Rights Reserved. Outline • Reason of Selecting Scala • Learning Scala in a Team • Architecture of GREE Chat • Obstacles • Summary
  • 7. • Reason of Selecting Scala • Learning Scala in a Team • Architecture of GREE Chat • Obstacles • Summary Copyright © GREE, Inc. All Rights Reserved. Outline
  • 8. Decide the Language based on the Requirement Copyright © GREE, Inc. All Rights Reserved.
  • 9. Requirements • Hundreds of thousands daily users • Real-time response Copyright © GREE, Inc. All Rights Reserved.  Connect with streaming • Run on a small number of servers  Utilize server resource effectively • Maintain for over 5 years 8/56
  • 10. Copyright © GREE, Inc. All Rights Reserved. ◎ GREE uses PHP so heavily • Many libraries and know-how in GREE △ Streaming • #connections = #processes △ Single thread, multi process • Overhead of spawning an OS process △ Maintainability • Dynamic typing 9/56
  • 11. ◎Compatible with concurrent programming ◎One process, many connections ◎High maintainability • Static typing • Functional programming (no side effects) ◎Stimulate new technology learning in GREE • Open to new languages & technologies! Copyright © GREE, Inc. All Rights Reserved. Scala! 10/56
  • 12. • Reason of Selecting Scala • Learning Scala in a Team • Architecture of GREE Chat • Obstacles • Summary Copyright © GREE, Inc. All Rights Reserved. Outline
  • 13. After adopting Scala … Copyright © GREE, Inc. All Rights Reserved.
  • 14. Only two Scala programmers in a team of seven Copyright © GREE, Inc. All Rights Reserved. Shortage of Scala experts 2/ 7 13/56
  • 15. Only two Scala programmers in a team of seven We must build up our skill! Copyright © GREE, Inc. All Rights Reserved. Shortage of Scala experts 2/ 7 14/56
  • 16. Copyright © GREE, Inc. All Rights Reserved. Learning of Scala 1. Self study 2. Study club 3. Pair programming 15/56
  • 17. Copyright © GREE, Inc. All Rights Reserved. 1. Self Study Understand the basic syntax
  • 18. Copyright © GREE, Inc. All Rights Reserved. 1. Self Study Books 17/56
  • 19. Copyright © GREE, Inc. All Rights Reserved. 1. Self Study Documents by Twitter https://twitter.github.io/scala_school/ http://twitter.github.io/effectivescala/ 18/56
  • 20. Copyright © GREE, Inc. All Rights Reserved. 1. Self Study Source code from OSS 19/56
  • 21. Copyright © GREE, Inc. All Rights Reserved. 2. Study Club Share what we learned by ourselves Introduction to functional programming
  • 22. 2. Study Club • Each engineer solves the problems provided by Scala experts Copyright © GREE, Inc. All Rights Reserved. • e.g., Binary Tree, Fibonacci Sequence 21/56
  • 23. • Example of factorial generation algorithm Copyright © GREE, Inc. All Rights Reserved. 2. Study Club Discussion with Members Use var Use recursion 22/56
  • 24. • Example of factorial generation algorithm Use var Use recursion Copyright © GREE, Inc. All Rights Reserved. 2. Study Club Discussion with Members No side effect 23/56
  • 25. 3. Pair Programming Practice by using the knowledge Copyright © GREE, Inc. All Rights Reserved. obtained from study club
  • 26. Copyright © GREE, Inc. All Rights Reserved. 3. Pair Programming • Effective learning • Learn about symbols (e.g., +, @), which cannot be searched easily on the Internet • Supplement the knowledge not taught at study club • Complex syntaxes (e.g., implicit, currying) • Development tools (e.g., sbt, IntelliJ) 25/56
  • 27. Copyright © GREE, Inc. All Rights Reserved. Summary: Adopting Scala • Reasons of selecting Scala • Compatible with concurrent programming • Maintainability because of static typing • Learning of Scala • Self Study, Study Club, Pair Programming • Big burdens on Scala experts • Needed for teaching team members • Maintain the quality of codes 26/56
  • 28. • Reason of Selecting Scala • Learning Scala in a Team • Architecture of GREE Chat • Obstacles • Summary Copyright © GREE, Inc. All Rights Reserved. Outline
  • 29. Architecture of Backend (simplified) Copyright © GREE, Inc. All Rights Reserved. • Servers separated by Queues • API Server: Process users’ requests • EventBus Server: Process events in Queue • Stream Server: Supply event to connected users 28/56
  • 30. Role of Each Server Copyright © GREE, Inc. All Rights Reserved. and Framework
  • 31. Copyright © GREE, Inc. All Rights Reserved. API Server Process users’ requests • Enqueue events • e.g., Send message Join/leave conversation • Techniques to process a lot of requests • Delegate heavy tasks (e.g., Disk I/O) to others • Logic is written to run asynchronously • scala.concurrent.Future 30/56
  • 32. • RPC system for JVM based on Netty • Support us to write asynchronous logic Copyright © GREE, Inc. All Rights Reserved. • Used by large scale web services • e.g., Twitter, Tumblr, Foursquare, Pinterest • Equipped with various clients • Redis, Memcached • With retry policy, connection pools 31/56
  • 33. Copyright © GREE, Inc. All Rights Reserved. EventBus Server Process events in Queue • Examples of tasks • Logging • Inquire GREE internal system • Store events in DB • etc. • Problems of concurrent processing • Deadlock, race condition, … 32/56
  • 34. Framework to write concurrent, distributed logic more easily • No need to handle shared resources Copyright © GREE, Inc. All Rights Reserved. • Race condition, dead-lock • Logic separation • Parent-Child • Fault tolerance 33/56
  • 35. Copyright © GREE, Inc. All Rights Reserved. Example of Akka 34/56
  • 36. Copyright © GREE, Inc. All Rights Reserved. Example of Akka Match by Event type 35/56
  • 37. Copyright © GREE, Inc. All Rights Reserved. Example of Akka Send copy to child 36/56
  • 38. Copyright © GREE, Inc. All Rights Reserved. Example of Akka log 37/56
  • 39. Copyright © GREE, Inc. All Rights Reserved. Stream Server Supply events to connected users • Connect by streaming • Increase connections as much as possible • Keep users data in the memory to reduce I/O • Asynchronous I/O by Finagle, Akka • Task division by Akka • Supply events to users • Update users data • Send KeepAlive to users 38/56
  • 40. Copyright © GREE, Inc. All Rights Reserved. Summary: Architecture • Each server is separated by Queue • API, EventBus, Stream Server • Framework is selected by considering asynchronous processing • Finagle, Akka • Task is divided by Akka • Easy to write concurrent logic 39/56
  • 41. Copyright © GREE, Inc. All Rights Reserved. Outline • Reason of Selecting Scala • Learning Scala in a Team • Architecture of GREE Chat • Obstacles • Summary
  • 42. Copyright © GREE, Inc. All Rights Reserved. Obstacles 1.JVM • Full GC 2. Self-created Scala library • Sharding • ID Architecture 41/56
  • 43. Full GC Problems Copyright © GREE, Inc. All Rights Reserved.
  • 44. • Scala runs on JVM • We want to prevent “stop the world” • GC in young generation is faster than full GC • Try not to let it store object in old generation Copyright © GREE, Inc. All Rights Reserved. Full GC Young generation Old generation 43/56
  • 45. Copyright © GREE, Inc. All Rights Reserved. Causes of Uncollected Reference Problem • Use method that has side effects • Reuse object everywhere • Forget to release used resources 44/56
  • 46. Copyright © GREE, Inc. All Rights Reserved. Causes of Uncollected Reference Problem • Use method that has side effects • Reuse object everywhere • Forget to release used resources Difficult to recognize by developers 45/56
  • 47. Copyright © GREE, Inc. All Rights Reserved. Short-Lived Object • Use val variable (final variable) • Don’t use mutable variable • Don’t leave references to objects for too long Create new objects instead of updating old ones 46/56
  • 48. Sharding: Scalable Storage 47/56 Copyright © GREE, Inc. All Rights Reserved.
  • 49. Copyright © GREE, Inc. All Rights Reserved. Scale up? 48/56
  • 50. Copyright © GREE, Inc. All Rights Reserved. Scale out! 49/56
  • 51. Copyright © GREE, Inc. All Rights Reserved. Horizontal Partitioning • Sharding is necessary! • Considering capacity and #accesses • We have Cascade, a sharding library • For PHP, not Scala • So, we created Aurora and make it OSS • Aurora and application were developed simultaneously • So difficult to integrate them during development • Code modification must be done in many parts 50/56
  • 52. ID Architecture: UUID and InnoDB Ref:MySQL InnoDB Primary Key Choice: GUID/UUID vs Integer Insert Performance http://kccoder.com/mysql/uuid-vs-int-insert-performance/ Copyright © GREE, Inc. All Rights Reserved.
  • 53. Ref:MySQL InnoDB Primary Key Choice: GUID/UUID vs Integer Insert Performance http://kccoder.com/mysql/uuid-vs-int-insert-performance/ Copyright © GREE, Inc. All Rights Reserved. UUID AUTO_INCREMENT #record #time
  • 54. Drop UUID, Take Time-Based • At first, we used UUID as primary key • But this caused MySQL to insert randomly • Created a library to generate ID instead • Referred to Snowflake by Twitter • Sequential insertion based on sorted created time 53/56 Copyright © GREE, Inc. All Rights Reserved.
  • 55. Copyright © GREE, Inc. All Rights Reserved. Summary: Obstacles & Workaround • JVM • Use short-lived objects to avoid Full GC • Self-created Scala library • Sharding • Made Scala library OSS • Integration of library to application was difficult • ID Architecture • Adopt time-based ID for sequential insertion 54/56
  • 56. Copyright © GREE, Inc. All Rights Reserved. Outline • Reason of Selecting Scala • Learning Scala in a Team • Architecture of GREE Chat • Obstacles • Summary
  • 57. Copyright © GREE, Inc. All Rights Reserved. Summary • Reasons for selecting Scala • Compatible with concurrent programming • Plan Scala learning within the team • Learning cost is expensive • Architecture & Frameworks • Each server is separated by Queue • Finagle, Akka • Shortage of libraries • We must have made libraries by ourselves • Needed to pull request to OSS repository 56/56
  • 58. Copyright © GREE, Inc. All Rights Reserved. Thanks! @tomoyoshi_ogura, @kyo_ago, @takc923 @yoshie_777, @le_chang, @beketa, @j5ik2o and ScalaMatsuri staffs

Editor's Notes

  1. 前半のプレゼンは 私が担当 後半 長谷川が担当 グリーで初めてのScalaプロダクト チャットサービスを作った リリースするまでの苦労や工夫について 30分
  2. 2013年に入社 それから チャットのバックエンド開発に参加している 大学時代はAndroidアプリケーションの開発 フロントエンジニアより
  3. 本日話すGREEチャットの画面例 動作のイメージは、 ざっくり言うと、GREEユーザ同士で会話できるLINE LINEさんが来ている前で こんなこと言うと怒られるかもしれませんが GREE Chatを作った目的 リアルタイムのコミュニケーションで、ユーザのアクティビティを活性化させるという目的
  4. 本日話す内容 数十万人の利用を想定するチャットのバックエンド Scalaでどのように構築したか
  5. このプレゼンのゴール 主な対象者=>これからScalaでプロダクトを構築する人 今回バックエンドをScalaで構築するにあたって得た知見の共有 具体的には 1.なぜScalaを選んだか 2 Scalaを利用して、どのようにチームで開発したか 3 どのようなシステム構成でどのようなフレームワークを選定したか 4 開発で苦労したこと、解決策
  6. Scalaを選んだ理由
  7. 言語を選定するにあたって、GREEチャットの要件から決めました
  8. 主な要件は4つ 1. 数十万の利用者を想定 2. チャット特有のリアルタイムなレスポンス 何千もストリーミングで同時接続できること 3. 少ないサーバ台数で稼働すること、コスト削減 =>サーバの資源を効率的に活用できる言語であるということが求められる 4. 5年以上の保守
  9. まず白羽の矢がたったのがPHP GREEの主要言語はPHP ->社内にライブラリや運用ノウハウがたくさんある 今回の要件に適さない問題が3つ(PHP disではない) 1 ストリーミング 接続数分だけプロセス数が必要 -> 何千とか接続してきたときにプロセスを立ち上げるのは辛い 2 基本的にシングルスレッド -> プロセス起動のオーバーヘッドが発生する -> サーバCPUを効率的に利用 難しい 3 保守性 ・動的型付け言語 => ある程度の規模になると、保守難しくなる その他:セミコロンが無い
  10. そこでScalaを採用しました 1.並行プログラミングとの親和性 -> CPUを効率よく使える -> サーバ台数少なくてすむ 2.一つのプロセスで複数のコネクション 3.保守性(静的型付け言語、関数型言語の特徴があるので、副作用がない関数をつくりやすい=>バグを生みにくい) 4.社内技術の活性化 (一つの言語に縛られないこと、) Javaと比較 短いコードの記述量 他にも細かいところ 色々あるが、決めてScalaが大好きなエンジニアがいたからScala
  11. どのようにチームでScalaを学んで言ったかについてお話します
  12. Scalaを採用したのはいいんですが
  13. Scalaの経験者は不足していました チーム7人中二人
  14. チームでScala力向上の必要
  15. 学習のコンテンツは3つです 1 自主学習 2 チームでの勉強会 3 経験者とペアプロ
  16. 目的:基本手な構文の理解 Scalaはどういった特徴
  17. 1 Programming in Scala (通称コップ本 言語設計上の話など詳細 1度に全部理解するのは困難だが、 何度も見返す Scala逆引きレシピ リファレンスとして手元に置いておく webの問題点として、回答の質がばらついている 逆引きリファレンスは質も網羅性も高い 著者が全員 登壇しているが、よいしょでも やらせでもなく
  18. Scala School コンソールで動きを確かめながら 手を動かしながら進めやすい Effective Scala コードのフォーマットからエラーハンドルまで、Twitterのscalaノウハウがあるので参考にしている
  19. Scalaのライブラリは、基本的にGithub上に公開されている Twittreの中の人が、どんなscalaコードを書いているかなど分かる 参考に
  20. 勉強会 目的:  個々の学びをチームで共有、 関数型プログラミングの入門
  21. Scala経験者が提供する練習問題作成 チームで問題を解く 二分木、フィボナッチ数列など
  22. できた回答をチームメンバーで共有し議論する 階乗計算の答えを2つ載せる 1 var 再代入可能な変数とforループを使用 2 再帰
  23. varを利用している方は、ループの中で再代入しているのが分かる 再帰: データの破壊的代入はしていな varのように後から変更可能な変数の利用 -> 自分が想定していない箇所で変更される可能性がある -> バグの元 (規模が大きくなってくるときつい) ◆チームの方針: 必要最小限の副作用で構成されたコードを目指す => 保守性を維持
  24. ペアプロ 経験者のサポートありで、 自主学習や勉強会で得た知識を実践で活用
  25. 利点 1.効果的な学習 記号が使われているがwebで検索できない問題->人に聞くのが早い Scalaでは様々な書き方できるが故に結局どう書いていいのか混乱 2.勉強会で補えないものを補足する a 難解な構文、implicit やカリー化、 なんでもかんでもimplicitにすればいいものじゃない b コード以外で言うと、sbtやIntelliJの効果的な使い方の共有 午前中に横田さんのsbtで一緒にやった方
  26. Scalaを選んだ理由 1 並行プログラミングと親和性高い 2 コードの保守性高い  静的型付け言語や副作用の無い関数型プロミングができるので Scalaの初期学習コストは、それなりにある ・自主学習、勉強会、ペアプロ ・チームで取り組む Scala経験者には負荷はかかる ・Scakaのノウハウの布教、コードのクオリティを保つためのコードレビュー
  27. GREEチャットのアーキテクチャ
  28. バックエンドの簡略図 青:アプリケーションサーバ、赤;Q Qで別れている。 CPUバウンド=>サーバ台数を増やすことでスケーリングすることが可能 API Server: ユーザのリクエストを受け付け 処理 EventBus Server: Qからデータを取得・加工 Stream Server: 接続しているユーザへデータを流す
  29. 各サーバの役割詳細 そこで利用しているフレームワークを紹介
  30. ユーザのリクエストを処理する Eventをエンキュー Event:メッセージの送信、会話の参加、離脱 大量のリクエストを捌く工夫 1.重い処理、例えばDisl I/Oは キューイングして 他のサーバへ委譲 ->ユーザのリクエストの受付に専念 2.ロジックは基本的に非同期処理(scalaのFutureライブラリを利用している)
  31. Finagle NettyをベースのRPCフレームワーク Twitter社が提供している、 非同期前提でアクションを書きやすい 2 他の大規模webサービスの事例もある ・Twitter, Tublr, Foursquare, Pinterest 3 サーバだけで無くクライアントも提供している Redis、Memcacheクライアントにも利用してる
  32. Qに積まれたEventの処理 例 ログ出力 GREE内部システムへ問い合わせ DBにstore等.. 複雑な処理を並行で効率良く捌く際の問題点 デッドロック、競合
  33. 並行・分散処理をより簡単に書くためのフレームワーク 特徴は3つ 1 共有データを処理する必要がない=> 競合、デッドロックで悩むことが無い 2 ロジックを親と子で階層構造で分けることができ、ロジックの分離・分散させやすい 3 耐障害性
  34. コードを使って、 Akkaが何故、並行処理をやりやすいか説明します 上と下は親子関係になっている 親はEventを子に割り振る 子はEventをログに出力する
  35. まず親が受け取ったEventの中から、 種類によって処理を変えます 赤線で囲まれた処理を説明していきます
  36. 子にEventを送る Eventはコピーされたもの =>共有オブジェクトの管理から解放されます
  37. 受け取った子はログに出力する これをデッドロックや競合なしで、並行で複数走っている
  38. 接続しているユーザへEventをStreamで送信している 接続数をできるだけ増やす工夫 1. ユーザ情報をメモリ上で管理している。Disk I/Oを減らしている 2. AkkaやFinagleを利用した非同期処理をここでも利用 Eventbus同様にいくつかの処理をAkkaで処理している 1 Eventをユーザへ送信 2 ユーザ情報の更新 3 KeepAliveの送信
  39. アーキテクチャの特徴としてQによってアプリケーションサーバを分けている フレームワークはFinagle,Akka,を採用している
  40. ここからは長谷川がお話します
  41. Gangliaというソフトウェアでヒープ領域を計測していたときの実際のグラフです。 左側が急上昇しているのはプログラムに一つおかしなところがあったからで、そこを修正してからは右側のように平穏で、リリース後は一度もFullGCが起きていません。 そこでこれからどのようにFullGCを防いできたかについて話します。
  42. FullGCが起こる原理から説明 JVMを使ってるからにはストップザ・ワールドを防ぐ なぜなら、サービスが一時的に停止してしまうから そこで、なるべくYoungでGCを起こすようにしたい もっというなら、Oldにobjectが移動しないようにしたい
  43. Old領域にobjectが移動してしまう原因の1つがobjectへの参照が開放されないこと 参照が開放されない原因はいくつかあって 1つ目が、副作用のあるメソッドを使うことです 2つ目が、objectの使い回し 3つ目が、使用したリソースを開放しない
  44. これらの原因は開発者が認識することは意外に難しく、日頃から意識しておく必要があります わたしたちのチームでは短命オブジェクトを作るということを心がけてきました
  45. 短命オブジェクトとはYoungで回収されるobjectを指す この短命オブジェクトを作るために、基本valを使う Var のようなmutableな変数を極力使わず、長く参照を残さないようにする この例は、チャットの会話情報をDBから引いてきて、それを変更し、保存するコード 全てvalで書かれていることがわかるように、conversationのparticipantIdsのみを部分的に変更するのではなく、新しいobjectを生成する このような工夫を至るところでおこなった結果、FullGCが起きていないことにつながったのではないか 今でも大きな変更を行うときには、jmapで変に参照が残っていないか確認したりしながら運用をしています。
  46. Shading分かる? なぜ、shardingをする必要あったか
  47. Shading分かる? なぜ、shardingをする必要あったか
  48. Shading分かる? なぜ、shardingをする必要あったか
  49. グリーチャットのようなI/Oが多く、ユーザーもそれなりに多いサービスになると、ストレージもスレールアウトできるように Sharding、つまりDBの水平分割をする必要があった Cascadeがあったが、PHP用でScala用じゃなかった そこでAuroraを作って、OSS化した ここまで聞くと、おおー、上手くやってるなと思う方もいるかもしれないですが、 実際はアプリケーションの開発とAuroraの開発が同時並行で進んでしまったため、途中でAuroraを組み込む必要がでてきました。 この影響で広範囲にわたって修正する必要があり、これに1ヶ月以上費やしたかと思います。 これはいい教訓になりました
  50. 次はUUIDとInnoDBの相性で苦労した話
  51. スライドに描かれた図 横軸:100万レコード 縦軸:Insertにかかる時間 緑がUUIDを利用した際のIntertTime Insertの速度が段違い つまり、UUIDをPrimary keyにするのはアンチパターン
  52. なんでこんな話をしているかというと、わたしたちがUUIDをPrimary keyとして利用していたから UUIDの悪いところはランダムインサートを引き起こすところ しかし、プログラムの設計上、AUTO_INCREMENTで採番したIDを利用することができない ので、自分たちでID生成ライブラリを作成 TwitterのSnowflakeを参考に 採番したIDは生成時刻でソートできるため、Insertするときにもほぼほぼシーケンシャルになる Snowflakeを使わなかったのは、Zookeeperで専用のID生成サーバーを管理する必要があったため、コストが高い 自分たちで作ったCornflakeというライブラリはもっとlightに使える
  53. 苦労したことのまとめ JVM周りではFull GCを起こさないように短命オブジェクトを作るよう意識がけていました ライブラリを自作した話では Shardingライブラリを途中で組み込んで大変だったこと それをOSSにしたこと Snowflakeを参考にしてシーケンシャルインサートできるID生成ライブラリを作成したこと
  54. 全体のまとめ Scalaを選んだ理由は、並行プログラミングとの親和性が大きかった チームのScala力向上はコストが高いので、それなりの時間を割いてチーム全体で取り組む必要がある Scalaは他の言語と比べると若い言語なので、ライブラリを自作したり、利用している外部ライブラリにプルリクエストを送るということは当たり前 最後に…