The document discusses how a video user profile service originally built in Ruby on Rails was scaled using Elixir. It initially increased resources and used containers, improving performance by 32% and 12% respectively. It was found one endpoint handled 80% of traffic. Rewriting this in Elixir improved performance by 95% and reduced containers by 35%. The results showed Elixir was able to significantly improve scalability and metrics for the growing user profile API.
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Scaling Video User Profile Service with Elixir
1. Using Elixir to scale
Video User Profile
Service
Emerson Macedo
@emerleite
2.
3. CONTEXT
User Profile API was developed in 2012.
It’s a well written Ruby on Rails
application , responsible for track
logged user actions
4. CONTEXT
User Profile API was developed in 2012.
It’s a well written Ruby on Rails
application , responsible for track
logged user actions
5. CONTEXT
Our Video Player POST Watched
Percentage to our Endpoint so we can
provide Keep Watching Percentage
to our Logged Users. It does it
every 10 seconds
6. CONTEXT
Our Video Player POST Watched
Percentage to our Endpoint so we can
provide Keep Watching Percentage
to our Logged Users. It does it
every 10 secondsx
x
28. CONTEXT
Our Video Player POST Watched
Percentage to our Endpoint so we can
provide Keep Watching Percentage
to our Logged Users. It does it
every 10 seconds
29. CONTEXT
Our Video Player POST Watched
Percentage to our Endpoint so we can
provide Keep Watching Percentage
to our Logged Users. It does it
every 10 secondsx
x
38. THIRD CHANGE
We saw that just ONE
endpoint was responsible for
80%, of application
throughput
39. THIRD CHANGE
We saw that just ONE
endpoint was responsible for
80%, of application
throughput
40. THIRD CHANGE
x
x
We saw that just ONE
endpoint was responsible for
80%, of application
throughput
41. CONTEXT
Our Video Player POST Watched
Percentage to our Endpoint so we can
provide Keep Watching Percentage
to our Logged Users. It does it
every 10 seconds
42. CONTEXT
Our Video Player POST Watched
Percentage to our Endpoint so we can
provide Keep Watching Percentage
to our Logged Users. It does it
every 10 secondsx
x
43. THIRD CHANGE
We saw that just ONE endpoint was
responsible for 80%, of application
throughput
44. THIRD CHANGE
We saw that just ONE endpoint was
responsible for 80%, of application
throughput
Pareto
45. THIRD CHANGE
We saw that just ONE endpoint was
responsible for 80%, of application
throughput
Pareto
20% of effort will solve
80% of the problem
74. TOOLS
We chosse phoenix
framework to create
our Elixir API and
we’re using many other
community libs
Ecto HTTPoison
Exrm CacheX
GenRetry FakeServer
Corsica
76. PROBLEMS
MongoDB Driver did not has
Replica Sets support. We had
to implement it
http//github.com/emerleite/mongox
http//github.com/emerleite/mongox_ecto
77. PROBLEMS
Elixir did not has NewRelic support.
We need to create an ad-hoc
implementation using Exometer
78. PROBLEMS
Elixir did not has NewRelic support.
We need to create an ad-hoc
implementation using Exometer
https://github.com/Feuerlabs/exometer_core