Slide 1

Slide 1 text

Riza Fahmi - ElixirDose.com - @rizafahmi22 - riza@ hacktiv8.com PRODUCTIVE. RELIABLE. FAST.

Slide 2

Slide 2 text

SPONSOR THANKS!

Slide 3

Slide 3 text

INTRODUCTION YOU’RE MY REGULATOR, MY COMPILER ▸ Scream when things go too fast / slow / are unclear ▸ Scream when cool things happen ▸ Help me when live coding, I’m suck at it. Find errors for me before the compiler do ▸ Similar to Phoenix channel, this is two way communication channel. Don’t let me do all the talking!

Slide 4

Slide 4 text

INTRODUCTION SLIDES ARE UP! https://slideshare.net

Slide 5

Slide 5 text

INTRODUCTION WHO AM I ▸ Was at CitizenLab, a Belgium-based early stage startup. As a CTO ▸ Now at Hacktiv8, a startup for dev bootcamp ▸ Run ElixirDose — an Elixir-focused blog since November 2013

Slide 6

Slide 6 text

INTRODUCTION WHAT WE’LL SEE ▸ The Awesomeness of Phoenix ▸ Build something with Phoenix ▸ Some live coding

Slide 7

Slide 7 text

SOME GLOSSARY Web Framework Programming Language Erlang Virtual Machine

Slide 8

Slide 8 text

WHAT IS PHOENIX

Slide 9

Slide 9 text

“Framework for building HTML5 apps, API backends and distributed systems to take on the modern web.” Chris McCord

Slide 10

Slide 10 text

HOW IS PHOENIX DIFFERENT?

Slide 11

Slide 11 text

PRODUCTIVITY PERFORMANCE VS

Slide 12

Slide 12 text

LET’S TALK PRODUCTIVITY

Slide 13

Slide 13 text

PRODUCTIVITY SHORT TERM ▸ Documentation / Guides / Generators ▸ Eliminates trivial choices

Slide 14

Slide 14 text

PRODUCTIVITY LONG TERM ▸ Maintainability ▸ Tried and true architecture patterns ▸ Let it crash mentality

Slide 15

Slide 15 text

“IF I HAVE TO BUILD SKYNET, KILLER ARTIFICIAL INTELLIGENT FROM TERMINATOR MOVIES, I WOULD USE ERLANG AND ERLANG VM. MOSTLY BECAUSE IT’S UNKILLABLE AND KEEP COMING BACK!” Simon St.Laurent from MostlyErlang Podcast

Slide 16

Slide 16 text

MORE FEATURES PLEASE…

Slide 17

Slide 17 text

FEATURES STATIC BUILD TOOLS WITH ES6 AS DEFAULT Ultra fast HTML5 build tools Compiles/lints your scripts and styles Concatenates your scripts and styles Minifies it Watches for file changes

Slide 18

Slide 18 text

FEATURES PRETTY AND HELPFUL ERROR PAGES

Slide 19

Slide 19 text

FEATURES CHANNELS ▸ The main reason why Phoenix exists in the first place ▸ It’s websocket with steroid ▸ Cross-platform, cross-languages ▸ For creating modern, real-time apps ▸ Beyond HTML

Slide 20

Slide 20 text

FEATURES MORE… ▸ Form builder ▸ Live reloading ▸ MCV with twist ▸ much more…

Slide 21

Slide 21 text

LET’S TALK PERFORMANCE NOW

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

PERFORMANCE VIEWS & TEMPLATES ▸ Precompiled and pretty fast! ▸ Views render templates ▸ It’s beyond HTML

Slide 24

Slide 24 text

PERFORMANCE WHAT ABOUT SOME BENCHMARK Frameworks Throughput (req/s) Latency (ms) Plug (Elixir) 54,948.14 3.83 Gin (Go) 51,483.20 1.94 Phoenix (Elixir) 43,063.45 2.82 Express Cluster (Nodejs) 27,669.46 3.73 Martini (Go) 14,798.46 6.81 Express (Nodejs) 9,965.56 10.07 Sinatra (Ruby) 9,182.86 6.55 Rails (Ruby) 3,274.81 17.25 https://github.com/mroth/phoenix-showdown

Slide 25

Slide 25 text

PERFORMANCE ROBUST CONCURRENCY MODEL ▸ “processes” is extremely lightweight units of concurrency ▸ Garbage collection is per process, no global pauses

Slide 26

Slide 26 text

“ WE DO NOT HAVE ONE WEB-SERVER HANDLING 2 MILLIONS SESSIONS. WE HAVE 2 MILLION WEBSERVERS HANDLING ONE SESSION EACH.” Joe Armstrong - Erlang Father http://goo.gl/DprVTC

Slide 27

Slide 27 text

LET’S BUILD SOMETHING

Slide 28

Slide 28 text

WHAT WE’LL BUILD ELIXIR VIDEO PORTAL ▸ CRUD app for collecting Elixir-related video ▸ Similar confreaks.tv or pyvideo.org

Slide 29

Slide 29 text

OFF ROAD… WE GO!

Slide 30

Slide 30 text

WANT MORE?

Slide 31

Slide 31 text

WANT MORE… READ SOME BOOKS

Slide 32

Slide 32 text

WANT MORE… WATCH AND LEARN

Slide 33

Slide 33 text

I’M DONE. THANKS FOR TUNING IN!