SlideShare a Scribd company logo
Better way to pay
ELIXIR
After 2 years in action
Oliver
Payout CTO
Sept 2019
Only
technologies
???
Plus My
Team
😂😂😂
Jana
Payout director
All Team
!!! <3 :-)
There is
something
missing!!!
Oliver,
what about
performance?
Peter
Payout founder
10k transactions/sec
Scaling everywhere
No Limits
We believe what we do
and how we do it
Oliver, which
technologies
we use?
.NET
😂😂😂😂
It’s hardcoded
Payout 2017
Elixir since 2017
Ruby since 2010
Intro - Oliver
Current version 1.9.1 (July 2019)
Since 2011
Based on BEAM (1982-1991 …)
Supported by Plataformatec
811 contributors
> 15k commits
Intro - Elixir
Forum
~ 12k topics
~10k users (2.5k active)
Slack > 22k users
Current version 1.4.10 (Sept 2019)
Since 2014
693 contributors
> 5k commits
Intro - Phoenix
Supported by Plataformatec
Plug vs Middleware(Rails)
Why Erlang
Erlang
● First choice 🤯
● + Partner companies use it
● + OTP (Fault tolerance)
● + In production for decades
● + Still active and progressive
● + Speed
● - Learning curve
● - Syntax
Why Elixir
Elixir
● Second choice
● + Erlang
● + Syntax
● + Syntax similar to Ruby
● + Learning curve
● + Phoenix
● - “Young” language
● - OOP -> FP
● - New Environment (Docker, …)
How we started
Rails developers
Minimal FP skills
First touch with
- Elixir,
- Erlang,
- Hex,
- Docker
- ...
What about YOU?
“Fears are nothing more than a state of mind.”
—Napoleon Hill
Multiple Processes
GenServers everywhere?
More |> (pipe operator)
Multiple applications
Cluster
Some advise
Own packages
More modular
Lost focus to Phoenix
Phoenix LiveView more
Let’s see some code
GenServer
Client - Server Behaviour
Supervised
One process
Synch/Async Messaging
State
GenServer
Very fast
State in Memory
Bottleneck
Simple Queue - Timeout
No concurrency
Solutions
- Pool boy
- DynamicSupervisor
- Task.async
GenServer
Very fast
State in Memory
Bottleneck
Simple Queue - Timeout
No concurrency
More
Solutions
- Pool boy
- DynamicSupervisor
- Task.async
Some hints
Pattern match in functions Tuple return
- fault tolerance flow
GenStage
“flow”/pipeline
multiple GenServers
buffers
producer,consumer,...
More
https://medium.com/@andreichernykh/elixir-a-few-things-about-genstage-id-wish-to-knew-some-time-ago-b826ca7d48ba
GenStage
https://medium.com/@andreichernykh/elixir-a-few-things-about-genstage-id-wish-to-knew-some-time-ago-b826ca7d48ba
Stream
lazy enumerables
lazy operations
future computations
More
Flow
GenStage
computations on collections
similar to Stream
More
Let’s see some code
Enum - 3 042 430 lines (440MB)
https://public.enigma.com/datasets/national-climatic-weather-center-consolidated-weather-reports-
1956/cc62066f-d7e4-4077-ac4e-d7cc09ceba33
Stream - 3 042 430 lines (440MB)
https://public.enigma.com/datasets/national-climatic-weather-center-consolidated-weather-reports-
1956/cc62066f-d7e4-4077-ac4e-d7cc09ceba33
Flow - 3 042 430 lines (440MB)
https://public.enigma.com/datasets/national-climatic-weather-center-consolidated-weather-reports-
1956/cc62066f-d7e4-4077-ac4e-d7cc09ceba33
Enum - 27 240 246 lines (4.55GB)
https://public.enigma.com/datasets/daily-weather-indications/d70070ae-5fce-4ccb-8b6f-c72f6ee5a75b
I turned off after one hour
Stream - 27 240 246 lines (4.55GB)
https://public.enigma.com/datasets/daily-weather-indications/d70070ae-5fce-4ccb-8b6f-c72f6ee5a75b
Flow - 27 240 246 lines (4.55GB)
https://public.enigma.com/datasets/daily-weather-indications/d70070ae-5fce-4ccb-8b6f-c72f6ee5a75b
Don’t forget, it’s not only
about time or memory!
Check this talk: ElixirConf 2019 - High Performance String Processing Scripts in
Elixir - Johanna Larsson
Video: https://youtu.be/Y83p_VsvRFA
Slides: https://files.jola.dev/talks/elixirconf-2019/
GitHub: https://github.com/joladev/high-performance-string-processing
Official Guides https://elixir-lang.org/getting-started/introduction.html
Elixir School https://elixirschool.com
Functional Web Development with Elixir, OTP, and Phoenix - Lance Halvorsen
The Little Elixir & OTP Guidebook - Benjamin Tan Wei Hao
Property-Based Testing with PropEr, Erlang, and Elixir - Fred Hebert
Example Data https://public.enigma.com/
Nice packages https://github.com/h4cc/awesome-elixir
Application Monitoring https://appsignal.com/
Materials
Questions
?????
oliver.kriska@payout.one
Skype: quatermain32
payout.one
Better way to pay

More Related Content

Elixir - After 2 years in action + code WebUp