Project Phoenix - From PHP to the Play Framework in 3 months
-
Upload
manuel-bernhardt -
Category
Software
-
view
957 -
download
0
description
Transcript of Project Phoenix - From PHP to the Play Framework in 3 months
![Page 1: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/1.jpg)
@elmanu#playframework
From PHP to the Play Framework in 3 months
Manuel Bernhardt @elmanu http://manuel.bernhardt.io
![Page 2: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/2.jpg)
@elmanu#playframework
Agenda
• Background
• Building the new platform
• Data migration
• Operations
• Summary & Future
![Page 3: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/3.jpg)
@elmanu#playframework
Your speaker
•Freelance software consultant based in Vienna !
•Web, web, web
•Scala, Akka, Play Framework !
•Vienna Scala User Group !
•Open-Source
![Page 4: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/4.jpg)
@elmanu#playframework
Agenda
• Background
• Building the new platform
• Data migration
• Operations
• Summary & Future
![Page 5: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/5.jpg)
@elmanu#playframework
Talenthouse
•www.talenthouse.com !
•based in Los Angeles !
•connecting brands and artists !
•3+ million users
![Page 6: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/6.jpg)
![Page 7: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/7.jpg)
![Page 8: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/8.jpg)
![Page 9: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/9.jpg)
![Page 10: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/10.jpg)
![Page 11: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/11.jpg)
@elmanu#playframework
Background
•Problems with the old site
• Slow
• Developed by an external company
• Hard to evolve
![Page 12: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/12.jpg)
@elmanu#playframework
Background
•Solution: new site!
• Scala
• Play Framework
• AngularJS
• elasticsearch
• …
![Page 13: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/13.jpg)
@elmanu#playframework
Background
•A few interesting aspects
• Source code may not be available
• Data spread out in many places
• Only 3 months time
![Page 14: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/14.jpg)
@elmanu#playframework
Background
•A few interesting aspects
• Source code may not be available
• Data spread out in many places
• Only 3 months time
![Page 15: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/15.jpg)
@elmanu#playframework
Agenda
• Background
• Building the new platform
• Data migration
• Operations
• Methodologies & Tools
• Summary & Future
![Page 16: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/16.jpg)
@elmanu#playframework
Building the new platform
![Page 17: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/17.jpg)
@elmanu#playframework
Building the new platform
![Page 18: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/18.jpg)
@elmanu#playframework
![Page 19: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/19.jpg)
@elmanu#playframework
• MVC framework !
• Compile as much as possible
• “Reactive”
![Page 21: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/21.jpg)
@elmanu#playframework
Load balancer
![Page 22: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/22.jpg)
@elmanu#playframework
Load balancer
![Page 23: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/23.jpg)
@elmanu#playframework
Building the new platform
Data access?
![Page 24: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/24.jpg)
@elmanu#playframework
Building the new platform
Anorm
Data access?
Squeryl
![Page 25: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/25.jpg)
@elmanu#playframework
Building the new platform
Anorm
Data access?
Squeryl
![Page 26: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/26.jpg)
@elmanu#playframework
Building the new platform
Anorm
Data access?
Squeryl
SORM Tiramisu
![Page 27: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/27.jpg)
@elmanu#playframework
Building the new platform
• Started with Anorm
• Too verbose !
• Switched to Slick
• Plain SQL with neat string interpolation
• DSL for composing queries
![Page 28: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/28.jpg)
@elmanu#playframework
Building the new platform
def fetchItemWithRelevanceSort(userId: Long, skip: Int, limit: Int)! (implicit s: Session): List[Item] = {! val q = for {! i <- items if !i.deleted! ! && i.visible_on_profile! ! && i.user_id === userId! } yield i! ! q.sortBy(item => (item.selected.desc, item.created_on.desc))! .drop(skip)! .take(limit)! .list!! }
![Page 29: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/29.jpg)
val query = sql"""! with invites_for_market as (! select #$inviteSL, #$inviteMarketSL! from invite i! inner join invite_market im! on i.id = im.invite_id! and im.market_id = ${marketId.id}! where i.art_type = ${artType.toString}! and i.visibility_state = ${InviteVisibilityState.Public}! and i.deleted = false! order by i.submission_start desc, i.id desc! limit $limit! offset $skip! )!! select ifm.*, #$localInviteSL! from invites_for_market ifm! inner join local_invite li! on ifm.id = li.invite_id! and li.completed = true! order by ifm.submission_start desc, ifm.id asc! """! val queryResults = query.as[(Invite, InviteMarket, LocalInvite)].list!
![Page 30: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/30.jpg)
@elmanu#playframework
Building the new platform
Front-end & UI
![Page 31: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/31.jpg)
@elmanu#playframework
Building the new platform
Front-end & UI
![Page 32: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/32.jpg)
![Page 33: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/33.jpg)
![Page 34: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/34.jpg)
![Page 35: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/35.jpg)
@elmanu#playframework
Building the new platform
Front-end & UI
![Page 36: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/36.jpg)
@elmanu#playframework
Building the new platform
• Recently open-sourced by Facebook !
• Virtual DOM, fast !
• Very easy to integrate in a page (less invasive than Angular)
ReactJS
![Page 37: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/37.jpg)
@elmanu#playframework
Building the new platform
Front-end & UI
![Page 38: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/38.jpg)
@elmanu#playframework
Building the new platform
• Build pipeline using gulp.js & bower !
• Assets pipeline
• LESS compilation
• JS minification
• Upload assets to Cloudfront
• Integrates translations from Crowdin
• Washes the dishes
![Page 39: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/39.jpg)
@elmanu#playframework
Agenda
• Background
• Building the new platform
• Data migration
• Operations
• Summary & Future
![Page 40: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/40.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 41: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/41.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 42: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/42.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 43: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/43.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 44: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/44.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 45: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/45.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 46: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/46.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 47: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/47.jpg)
@elmanu#playframework
Data migration: source system(s)
![Page 48: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/48.jpg)
@elmanu#playframework
Data migration: migration schedule
![Page 49: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/49.jpg)
@elmanu#playframework
Data migration
• Akka to the rescue! !
• Concurrent user migration !
• Concurrent item migration
• Using Play’s WS library for async calls to Youtube and friends
![Page 50: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/50.jpg)
@elmanu#playframework
Data migration
User migrator
Worker Worker Worker Worker Worker
![Page 51: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/51.jpg)
@elmanu#playframework
Data migration
Item migrator
![Page 52: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/52.jpg)
@elmanu#playframework
Data migration
Item migrator
User item migrator
User item migrator
User item migrator
![Page 53: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/53.jpg)
@elmanu#playframework
Data migration
Item migrator
Item migration
worker
User item migrator
User item migrator
User item migrator
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
![Page 54: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/54.jpg)
@elmanu#playframework
Data migration
Item migrator
Item migration
worker
User item migrator
User item migrator
User item migrator
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
File fetcher
File fetcher
![Page 55: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/55.jpg)
@elmanu#playframework
Data migration
Item migrator
Item migration
worker
User item migrator
User item migrator
User item migrator
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
File fetcher
File fetcher
File uploader
File uploader
![Page 56: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/56.jpg)
@elmanu#playframework
Data migration
Item migrator
Item migration
worker
User item migrator
User item migrator
User item migrator
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
Item migration
worker
File fetcher
File fetcher
File uploader
Soundcloud worker
File uploader
![Page 57: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/57.jpg)
@elmanu#playframework
Data migration
![Page 58: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/58.jpg)
@elmanu#playframework
Agenda
• Background
• Building the new platform
• Data migration
• Operations
• Summary & Future
![Page 59: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/59.jpg)
@elmanu#playframework
Operations
Operations
![Page 60: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/60.jpg)
@elmanu#playframework
Operations
![Page 61: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/61.jpg)
@YourTwitterHandle#DVXFR14{session hashtag} @elmanu#playframework
Summar
y
& Futu
re
![Page 62: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/62.jpg)
@elmanu#playframework
Summary & Future
• Play Framework does not get in the way
• Easy to deploy and operate
• Many, many integrations !
• Many plans for the future
• Live activity feed
• Similarity search !
• Talenthouse is hiring!
![Page 63: Project Phoenix - From PHP to the Play Framework in 3 months](https://reader036.fdocuments.us/reader036/viewer/2022081401/5582387cd8b42a0d368b4bfb/html5/thumbnails/63.jpg)
@YourTwitterHandle#DVXFR14{session hashtag} @elmanu#playframework
Q & A