Beyond your daily coding
Emerson Macedo
@emerleite
2008
2008
Some guys created a project
using Ruby on Rails when
Orkut Apps were cool
2008
Some guys created a project
using Ruby on Rails when
Orkut Apps were cool
2008
Some guys created a project
using Ruby on Rails when
Orkut Apps were cool
2008
Ruby on Rails receive a
big red flag from lots of
influencers inside the
company.
2009
2009
I was working in a Fotolog web
application created using Java
J2EE , before Facebook killed
all these photo websites
2009
I was working in a Fotolog web
application created using Java
J2EE , before Facebook killed
all these photo websites
2009
Inside Big companies, it
was very popular to use a
Reference Architecture
for all applications
2009
Reference
Architecture
2009
In the end of 2009 a project to
create a sing in system for
reality shows came to our
team
2009
In the end of 2009 a project to
create a sing in system for
reality shows came to our
team
2009
We all knew that Ruby on
Rails development lifecycle
was faster and this project
could be a good fit
2009
Sometimes you have to take
risks to achieve important
goals and generate high
impact
2009
Sometimes you have to take
risks to achieve important
goals to generate high
impact
2009
I spend my after work time
teaching my coworkers how
to program in Ruby and
Rails
2010
2010
In may, we put again a Ruby
on Rails project in
production
2010
The expectation was to deliver
in July ,but we delivered the
application two months
early
2016
2017
What about 2010 to 2016?
You did nothing?
2016
After 2010, lots of projects
at globo.com were written
using Ruby on Rails
2016
After 2010, lots of projects
at globo.com were written
using Ruby on Rails
Mission
Accomplished
Video User Profile
Service
CONTEXT
User Profile Service was developed in
2012. It’s a well written Ruby on Rails
application , responsible for track
logged user actions
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
CONTEXT
Globo is making
Binge Watching
experiments combined
with Online First for
new TV Shows
TV Shows
CONTEXT
Prepare all Video
Applications for the
Olympics
Online First
Binge Watching
THE PROBLEM
2013
10k
The throughput increased
between 2013 and 2016
2013 2016
10k
60k
THE PROBLEM
The throughput increased
between 2013 and 2016 ~600%
2013 2016
10k
60kTHE PROBLEM
It was hard to predict the new
Appication Throughput
2016 / 2
?
INFRASTRUCTURE
2 bare metals, each one
with 24 CPUs and 64GB
of RAM
THE PROBLEM
The average response time
was good, but percentiles
were hurting the application
Avg
70ms
70ms
THE PROBLEM
The average response time
was good, but percentiles
were hurting the application
99
2.5s
95
1s
Avg
FIRST CHANGE
We increased the
computational resources
from 2 to 4 bare metals
FIRST CHANGE
We increased the
computational resources
from 2 to 4 bare metals Each one with
24 CPUs and
64GB of RAM
70ms
99
2.5s
95
1s
Avg
FIRST CHANGE
This change improved
metrics by ~32%
FIRST CHANGE
This change improved
metrics by ~32%
9995
1.7s
0.7s
Avg
47ms
~32%
better
SECOND CHANGE
We decided to try a deployment with
Tsuru containers with auto scaling, each
one with 1-4 vCPU and 2GB of RAM
SECOND CHANGE
We decided to try a deployment with
Tsuru containers with auto scaling, each
one with 1-4 vCPU and 2GB of RAM
93 containers
SECOND CHANGE
9995
1.7s
0.7s
Avg
47ms
Migrate to containers improved
metrics by ~12%
SECOND CHANGE
9995
1.5s
0.5s
Avg
41ms
Migrate to containers improved
metrics by ~12%
~12%
better
2013 2016
10k
60kELIXIR VERSION RESULTS
After the Olympics and with
Binge Watching, the
throughput increased ~50%
2013 2016
10k
60kELIXIR VERSION RESULTS
After the Olympics and with
Binge Watching, the
throughput increased ~50%
2016 / 2
90k
ELIXIR VERSION RESULTS
From 4 bare metals, using
24 CPUs and 64GB of
RAM to 33 containers,
using 1-4 vCPU and 2GB
of RAM
3 containers30 containers
ElixirRuby
ELIXIR VERSION RESULTS
9995
1.5s
0.5s
Avg
41ms
Elixir version improved
metrics by ~95%
ELIXIR VERSION RESULTS
9995
30ms
15ms
Avg
4ms
Elixir version improved
metrics by ~95%
~95%
better
ELIXIR VERSION RESULTS
I presented the Elixir
version to the Globo
Technology Committee
2017
2017
This year we delivered
mission critic projects in
production at globo.com
using Elixir
2017
This year we delivered
mission critic projects in
production at globo.com
using Elixir
Mission
Accomplished
HOW TO DO THE SAME?
What the story about Ruby
on Rails and the story about
Elixir have in common?
HOW TO DO THE SAME?
First, we have to understand
how the game works. It’s
simple, we just need to
accept it
HOW THE GAME WORKS
Your boss wants profit. He pays
you a good salary because his
expectation is that you will make
his company more profitable
HOW THE GAME WORKS
You’re paid to deliver value.
Your company is not
expecting you to write
code like a monkey.
HOW THE GAME WORKS
Value is recognized with
perception. It’s not always
fair, but’s the game. Again, we
just need to accept it
HOW THE GAME WORKS
If your employer trusts you, he’ll be
have a better perception about
your job and also be more open to
your ideas that challenges the
status-quo
HOW THE GAME WORKS
Start doing your daily job
the best you can, so the trust
will came. Do not challenge
the status-quo before this.
HOW TO DO THE SAME?
What the story about Ruby
on Rails and the story about
Elixir have in common?
HOW TO DO THE SAME?
In 2009, Ruby on Rails was
probably in the Early
Adopters group. Java was
for the Laggards
HOW TO DO THE SAME?
In 2009, Ruby on Rails was
probably in the Early
Adopters group. Java was
for the Laggards
HOW TO DO THE SAME?
In 2016, Ruby on Rails was in
the Laggards group and
Elixir in the Early Adopters
group.
HOW TO DO THE SAME?
People may think Globo is
always in the Early Adopters
group, but it’s not true.
HOW TO DO THE SAME?
We’re often between the
Early Adopters and Early
Majority groups, but be
Early Adopter is good for us
HOW TO DO THE SAME?
What is the pattern from Ruby
on Rails and Elixir story at
globo.com?
HOW TO DO THE SAME?
Find the opportunities.
They’re everywhere.
Sometimes it’s not easy to
find then, but they’re there.
x
x
x
x
1
HOW TO DO THE SAME?
Create pet projects or do
some freelancer or
experiments with the tool
you want to introduce in your
company
2
HOW TO DO THE SAME?
Sell it to your coworkers. You will
not have success alone. People
often work at a team, so it will be
good if they buy your solution
3
HOW TO DO THE SAME?
Create a POC with the
solution you thought to solve
the problem you have
identified
4
HOW TO DO THE SAME?
Present your results to the
stakeholders. They will be
the engine to support you
spread the solution
5
YouÊre paid to
deliver value not code
That’s all folks
Emerson Macedo
@emerleite
https://blog.emerleite.com

Beyond your daily coding - The Conf Brazil 2017 Keynote