SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Doing the Erlang dance 
A case study 
Arjan Scherpenisse 
@acscherp
Who am I? 
● Wide range of interests 
● Polyglot programmer 
● Contributor to Open Source Software 
● Doing things differently...
Where others use … , I use … 
● Mac → Linux 
● iOS → Android 
● Textmate Sublime Text → Emacs 
● … → Erlang!
Introducing:
Do the DuoDisco! 
● Mark Meeuwenoord, Klasien van de Zandschulp, 
James Bryan Graves 
● It’s fun. Profit comes later 
1. Download app 
2. Join disco 
3. Dance 
4. Find partner → score! 
5. goto 3
DuoDisco Architecture 
● Table: player 
○ id 
○ name 
○ status (“waiting”, “playing”, “loading”, etc) 
○ connected (true / false) 
○ connected_to (player id FK) 
○ current_song_id
Disco architecture issues 
● Race Condition Paradise 
○ Connection drops 
○ Connection latency 
○ Subtle client differences 
● These bugs never happen while you’re 
developing 
● Player A → Player B, Player B → Player C 
○ Debugging nightmare..
So what about that Erlang thing? 
● A language, VM and runtime system 
● Fault tolerant 
● Concurrent 
● Functional 
● In use by major players
Erlang: Fault Tolerance 
● Systems will error 
● “Let it crash” 
○ Only program the happy path 
● You will be restarted 
○ by your supervisor 
○ with a clean slate
Erlang: Concurrence 
● Processes (“Actors”) are cheap 
● Processes communicate 
● Processes contain state
Erlang: It’s Functional 
● Assign-once 
● Pattern matching 
● No loops 
○ use (tail)recursion 
○ list comprehensions, map/reduce 
● It has a WEIRD SYNTAX? ?F()(*$#)(*# 
○ I had to say it somewhere 
○ Look at Elixir, it rocks. http://elixir-lang.org/
Erlang + Web = Zotonic 
● “The Django of Erlang” 
● Web development framework 
○ Built-in web server; CMS 
○ Opinionated & extensible 
● Great performance out-of-the-box 
● Easy to use data model 
○ Semantic web “everything is a thing”
Back in the Disco… 
● 3 clients, iOS, Android & HTML 
● Backend: Erlang + Zotonic (obviously...) 
● JSON over WebSockets 
● REST for login / discovery 
● Zotonic manages data model 
○ (media files, multiple disco’s)
DuoDisco refactoring 
● Model it the Erlang way 
● Every player is a process 
● “Room” processes for connected players 
● One match-making process 
○ Uses process registry for querying processes
DuoDisco findings 
● First try-out at Extrapool Festival 2 wks ago 
● No more weird bugs! 
● Lessons learned 
○ Think (a bit) before you code 
○ Use the right tool for the job 
○ Dare to iterate and start over
Links 
http://erlang.org/ - the Erlang language 
http://zotonic.com/ - The web framework 
http://duodisco.nl/ - Duo Disco app info 
http://elixir-lang.org/ - Erlang with different syntax
Thanks! Questions? 
Contact: 
● http://twitter.com/acscherp 
● http://miraclethings.nl/ 
● http://github.com/arjan 
● buy me a beer :p

Contenu connexe

En vedette

The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166GZ-Israel
 
Ezvc
EzvcEzvc
Ezvcezvc
 
Israel 1214781329718633 9
Israel 1214781329718633 9Israel 1214781329718633 9
Israel 1214781329718633 9GZ-Israel
 
Mediamatic Night Lab #2
Mediamatic Night Lab #2Mediamatic Night Lab #2
Mediamatic Night Lab #2Arjan
 
O Meu Pequeno Pais
O Meu Pequeno PaisO Meu Pequeno Pais
O Meu Pequeno PaisGZ-Israel
 
Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8GZ-Israel
 
Hello, world
Hello, worldHello, world
Hello, worldArjan
 
O mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos PenelaO mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos PenelaGZ-Israel
 
Arava Sites By Guy
Arava Sites By GuyArava Sites By Guy
Arava Sites By GuyGZ-Israel
 
Tel Aviv 1920 1940
Tel Aviv 1920 1940Tel Aviv 1920 1940
Tel Aviv 1920 1940GZ-Israel
 
Android workshop
Android workshopAndroid workshop
Android workshopArjan
 
Tweets polls surveys
Tweets polls surveysTweets polls surveys
Tweets polls surveysSandra Hines
 
Alice Quick Guide
Alice Quick GuideAlice Quick Guide
Alice Quick GuideKJSROSE
 
Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011Arjan
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceArjan
 

En vedette (20)

The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166The State Of Israel And The Muslim World 22166
The State Of Israel And The Muslim World 22166
 
Ezvc
EzvcEzvc
Ezvc
 
Rami Meiri
Rami MeiriRami Meiri
Rami Meiri
 
Israel 1214781329718633 9
Israel 1214781329718633 9Israel 1214781329718633 9
Israel 1214781329718633 9
 
Road
RoadRoad
Road
 
Mediamatic Night Lab #2
Mediamatic Night Lab #2Mediamatic Night Lab #2
Mediamatic Night Lab #2
 
O Meu Pequeno Pais
O Meu Pequeno PaisO Meu Pequeno Pais
O Meu Pequeno Pais
 
Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8Israelair Photos 1214209899278185 8
Israelair Photos 1214209899278185 8
 
Hello, world
Hello, worldHello, world
Hello, world
 
O mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos PenelaO mar desde esa banda. De Carlos Penela
O mar desde esa banda. De Carlos Penela
 
IPsec
IPsecIPsec
IPsec
 
Arava Sites By Guy
Arava Sites By GuyArava Sites By Guy
Arava Sites By Guy
 
Tel Aviv 1920 1940
Tel Aviv 1920 1940Tel Aviv 1920 1940
Tel Aviv 1920 1940
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Tweets polls surveys
Tweets polls surveysTweets polls surveys
Tweets polls surveys
 
Maketechwork4u
Maketechwork4uMaketechwork4u
Maketechwork4u
 
Alice Quick Guide
Alice Quick GuideAlice Quick Guide
Alice Quick Guide
 
Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011Zotonic presentation Erlang Camp Boston, august 2011
Zotonic presentation Erlang Camp Boston, august 2011
 
Mother
MotherMother
Mother
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & Performance
 

Similaire à Duo Disco - doing the Erlang dance

Webbisauna - ClojureScript for Javascript Developers
Webbisauna - ClojureScript for Javascript DevelopersWebbisauna - ClojureScript for Javascript Developers
Webbisauna - ClojureScript for Javascript DevelopersJuho Teperi
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a NutshellRangHo Lee
 
HelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersJuho Teperi
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engineMichalis Kamburelis
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdScott Tsai
 
Functional Programming With Elixir
Functional Programming With ElixirFunctional Programming With Elixir
Functional Programming With ElixirFramgia Vietnam
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015Jorg Janke
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLeszek Godlewski
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional ProgrammerDave Cross
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopTamas K Lengyel
 
Don't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade MachinesDon't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade MachinesMichael Scovetta
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)Ary Borenszweig
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)Ary Borenszweig
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)Crystal Language
 
Schizophrenic files v2
Schizophrenic files v2Schizophrenic files v2
Schizophrenic files v2Ange Albertini
 

Similaire à Duo Disco - doing the Erlang dance (20)

Webbisauna - ClojureScript for Javascript Developers
Webbisauna - ClojureScript for Javascript DevelopersWebbisauna - ClojureScript for Javascript Developers
Webbisauna - ClojureScript for Javascript Developers
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a Nutshell
 
Static analysis for beginners
Static analysis for beginnersStatic analysis for beginners
Static analysis for beginners
 
HelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript Developers
 
Castle Game Engine and the joy of making and using a custom game engine
Castle Game Engine and the joy  of making and using a custom game engineCastle Game Engine and the joy  of making and using a custom game engine
Castle Game Engine and the joy of making and using a custom game engine
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsd
 
Functional Programming With Elixir
Functional Programming With ElixirFunctional Programming With Elixir
Functional Programming With Elixir
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology aside
 
Ruxmon.2013-08.-.CodeBro!
Ruxmon.2013-08.-.CodeBro!Ruxmon.2013-08.-.CodeBro!
Ruxmon.2013-08.-.CodeBro!
 
Introdução à Elixir
Introdução à ElixirIntrodução à Elixir
Introdução à Elixir
 
erlang 101
erlang 101erlang 101
erlang 101
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Dfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshopDfrws eu 2014 rekall workshop
Dfrws eu 2014 rekall workshop
 
Don't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade MachinesDon't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade Machines
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Cloud accounting software uk
Cloud accounting software ukCloud accounting software uk
Cloud accounting software uk
 
Schizophrenic files v2
Schizophrenic files v2Schizophrenic files v2
Schizophrenic files v2
 

Plus de Arjan

De Naakte Noorderlingen
De Naakte NoorderlingenDe Naakte Noorderlingen
De Naakte NoorderlingenArjan
 
Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013Arjan
 
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent worldErlang: Software for a Concurrent world
Erlang: Software for a Concurrent worldArjan
 
Physical Computing with Android and IOIO
Physical Computing with Android and IOIOPhysical Computing with Android and IOIO
Physical Computing with Android and IOIOArjan
 
Open-CI for beginners
Open-CI for beginnersOpen-CI for beginners
Open-CI for beginnersArjan
 
OBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic SalonOBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic SalonArjan
 

Plus de Arjan (6)

De Naakte Noorderlingen
De Naakte NoorderlingenDe Naakte Noorderlingen
De Naakte Noorderlingen
 
Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013Zotonic tutorial EUC 2013
Zotonic tutorial EUC 2013
 
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent worldErlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
 
Physical Computing with Android and IOIO
Physical Computing with Android and IOIOPhysical Computing with Android and IOIO
Physical Computing with Android and IOIO
 
Open-CI for beginners
Open-CI for beginnersOpen-CI for beginners
Open-CI for beginners
 
OBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic SalonOBG Presentatie Mediamatic Salon
OBG Presentatie Mediamatic Salon
 

Dernier

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Dernier (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Duo Disco - doing the Erlang dance

  • 1. Doing the Erlang dance A case study Arjan Scherpenisse @acscherp
  • 2. Who am I? ● Wide range of interests ● Polyglot programmer ● Contributor to Open Source Software ● Doing things differently...
  • 3. Where others use … , I use … ● Mac → Linux ● iOS → Android ● Textmate Sublime Text → Emacs ● … → Erlang!
  • 5. Do the DuoDisco! ● Mark Meeuwenoord, Klasien van de Zandschulp, James Bryan Graves ● It’s fun. Profit comes later 1. Download app 2. Join disco 3. Dance 4. Find partner → score! 5. goto 3
  • 6. DuoDisco Architecture ● Table: player ○ id ○ name ○ status (“waiting”, “playing”, “loading”, etc) ○ connected (true / false) ○ connected_to (player id FK) ○ current_song_id
  • 7.
  • 8. Disco architecture issues ● Race Condition Paradise ○ Connection drops ○ Connection latency ○ Subtle client differences ● These bugs never happen while you’re developing ● Player A → Player B, Player B → Player C ○ Debugging nightmare..
  • 9.
  • 10. So what about that Erlang thing? ● A language, VM and runtime system ● Fault tolerant ● Concurrent ● Functional ● In use by major players
  • 11. Erlang: Fault Tolerance ● Systems will error ● “Let it crash” ○ Only program the happy path ● You will be restarted ○ by your supervisor ○ with a clean slate
  • 12. Erlang: Concurrence ● Processes (“Actors”) are cheap ● Processes communicate ● Processes contain state
  • 13. Erlang: It’s Functional ● Assign-once ● Pattern matching ● No loops ○ use (tail)recursion ○ list comprehensions, map/reduce ● It has a WEIRD SYNTAX? ?F()(*$#)(*# ○ I had to say it somewhere ○ Look at Elixir, it rocks. http://elixir-lang.org/
  • 14. Erlang + Web = Zotonic ● “The Django of Erlang” ● Web development framework ○ Built-in web server; CMS ○ Opinionated & extensible ● Great performance out-of-the-box ● Easy to use data model ○ Semantic web “everything is a thing”
  • 15. Back in the Disco… ● 3 clients, iOS, Android & HTML ● Backend: Erlang + Zotonic (obviously...) ● JSON over WebSockets ● REST for login / discovery ● Zotonic manages data model ○ (media files, multiple disco’s)
  • 16. DuoDisco refactoring ● Model it the Erlang way ● Every player is a process ● “Room” processes for connected players ● One match-making process ○ Uses process registry for querying processes
  • 17.
  • 18.
  • 19. DuoDisco findings ● First try-out at Extrapool Festival 2 wks ago ● No more weird bugs! ● Lessons learned ○ Think (a bit) before you code ○ Use the right tool for the job ○ Dare to iterate and start over
  • 20. Links http://erlang.org/ - the Erlang language http://zotonic.com/ - The web framework http://duodisco.nl/ - Duo Disco app info http://elixir-lang.org/ - Erlang with different syntax
  • 21. Thanks! Questions? Contact: ● http://twitter.com/acscherp ● http://miraclethings.nl/ ● http://github.com/arjan ● buy me a beer :p