SlideShare a Scribd company logo
Lightweight APIs in mRuby
1 / 57
Who am I
2 / 57
Who am I
Name's Mikhail Bortnyk
3 / 57
Who am I
Name's Mikhail Bortnyk
Ruby developer and team leader in R&R Music Ukraine
4 / 57
Who am I
Name's Mikhail Bortnyk
Ruby developer and team leader in R&R Music Ukraine
Co-creator of Kottans school
5 / 57
Who am I
Name's Mikhail Bortnyk
Ruby developer and team leader in R&R Music Ukraine
Co-creator of Kottans school
Geek, polyglot, software development addict
6 / 57
Who am I
Name's Mikhail Bortnyk
Ruby developer and team leader in R&R Music Ukraine
Co-creator of Kottans school
Geek, polyglot, software development addict
github: @vessi
7 / 57
Who am I
Name's Mikhail Bortnyk
Ruby developer and team leader in R&R Music Ukraine
Co-creator of Kottans school
Geek, polyglot, software development addict
github: @vessi
twitter: @mikhailbortnyk
8 / 57
What is mRuby
9 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
10 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
can be linked and embedded into your application
11 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
can be linked and embedded into your application
can compile your software into bytecode
12 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
can be linked and embedded into your application
can compile your software into bytecode
can generate C code for embedding bytecode
13 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
can be linked and embedded into your application
can compile your software into bytecode
can generate C code for embedding bytecode
author: Yukihiro 'matz' Matsumoto
14 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
can be linked and embedded into your application
can compile your software into bytecode
can generate C code for embedding bytecode
author: Yukihiro 'matz' Matsumoto
github: github://mruby/mruby
15 / 57
What is mRuby
mRuby is lightweight implementation of Ruby complying (partially) to
ISO/IEC 30170:2012
can be linked and embedded into your application
can compile your software into bytecode
can generate C code for embedding bytecode
author: Yukihiro 'matz' Matsumoto
github: github://mruby/mruby
latest version: 1.1.0
16 / 57
Typical Rails project
17 / 57
Typical Rails project (I am so sorry for it,
mom!)
18 / 57
Typical Rails project
it's based on Rack
19 / 57
Typical Rails project
it's based on Rack
it contains a lot of business processes
20 / 57
Typical Rails project
it's based on Rack
it contains a lot of business processes
it responds to many routes
21 / 57
Typical Rails project
it's based on Rack
it contains a lot of business processes
it responds to many routes
often too heavy to serve tons of lightweight requests without scaling
22 / 57
Typical Rails project
it's based on Rack
it contains a lot of business processes
it responds to many routes
often too heavy to serve tons of lightweight requests without scaling
So, what is the solution?
23 / 57
Solutions
24 / 57
Solutions
You have a problem and decide to use threads. Two now problems have
you.
25 / 57
Solutions
You have a problem and decide to use threads. Two now problems have
you.
You have a problem and decide to use functional languages. Now your
problems are immutable.
26 / 57
Solutions
You have a problem and decide to use threads. Two now problems have
you.
You have a problem and decide to use functional languages. Now your
problems are immutable.
You have a problem and decide to use Java. Now you have
ProblemsFactory.
27 / 57
Solutions
You have a problem and decide to use threads. Two now problems have
you.
You have a problem and decide to use functional languages. Now your
problems are immutable.
You have a problem and decide to use Java. Now you have
ProblemsFactory.
You have a problem and decide...
28 / 57
Kill it with fire!
29 / 57
Kill it with fire!
Microservices
30 / 57
Microservices
31 / 57
Microservices
32 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
33 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
34 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
35 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
be lightweight
36 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
be lightweight
be stable
37 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
be lightweight
be stable
don't switch technology stack aggresively
38 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
be lightweight
be stable
don't switch technology stack aggresively
So, I decided to use mRuby. What do we have for serving web here?
39 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
be lightweight
be stable
don't switch technology stack aggresively
So, I decided to use mRuby. What do we have for serving web here?
mod_mruby. Apache module that executes mRuby code inside Apache
process.
40 / 57
Microservices
The idea is to split big project in bunch of independent lightweight services.
Requirements:
be fast
be lightweight
be stable
don't switch technology stack aggresively
So, I decided to use mRuby. What do we have for serving web here?
mod_mruby. Apache module that executes mRuby code inside Apache
process.
ngx_mruby. Perfectly the same but with Nginx flavour.
41 / 57
Little demonstration
Microservice without any service
42 / 57
Little demonstration
Used software:
nginx (ALL)
docker (ALL)
docker-compose (ALL)
mongodb (ALL)
ab (ALL)
unicorn gem (rack)
rack gem (rack)
rack-routing gem (rack)
mongo gem (rack)
ngx_mruby (mRuby)
mruby-mongo (mRuby)
43 / 57
Rack execution
$> cd testlab/rack
$> docker-compose up
$> ab -n 10000 -c 100 http://192.168.0.100:10080/api/contacts
# and kill docker-compose with ^C
44 / 57
Rack stats (page 1)
Document Path: /api/contacts
Document Length: 537 bytes
Concurrency Level: 100
Time taken for tests: 7.897 seconds
Complete requests: 10000
Failed requests: 4399
(Connect: 0, Receive: 0, Length: 4399, Exceptions: 0)
Non-2xx responses: 5601
Total transferred: 5080859 bytes
HTML transferred: 3434440 bytes
Requests per second: 1266.27 [#/sec] (mean)
Time per request: 78.972 [ms] (mean)
Time per request: 0.790 [ms] (mean, across all concurrent requests)
Transfer rate: 628.29 [Kbytes/sec] received
45 / 57
Rack stats (page 2)
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 4.1 2 34
Processing: 1 74 72.1 23 423
Waiting: 1 74 72.0 22 423
Total: 2 78 72.2 27 426
Percentage of the requests served within a certain time (ms)
50% 27
66% 135
75% 147
80% 154
90% 174
95% 192
98% 216
99% 232
100% 426 (longest request)
46 / 57
mRuby execution
$> cd testlab/rack
$> docker-compose up
$> ab -n 10000 -c 100 http://192.168.0.100:10080/api/contacts
# and kill docker-compose with ^C
47 / 57
mRuby stats (page 1)
Document Path: /api/contacts
Document Length: 98 bytes
Concurrency Level: 100
Time taken for tests: 6.721 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 2140000 bytes
HTML transferred: 980000 bytes
Requests per second: 1487.83 [#/sec] (mean)
Time per request: 67.212 [ms] (mean)
Time per request: 0.672 [ms] (mean, across all concurrent requests)
Transfer rate: 310.93 [Kbytes/sec] received
48 / 57
mRuby stats (page 2)
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 3 5.9 0 29
Processing: 5 64 27.5 68 132
Waiting: 5 64 27.6 68 131
Total: 14 67 24.4 69 132
Percentage of the requests served within a certain time (ms)
50% 69
66% 78
75% 83
80% 88
90% 102
95% 106
98% 112
99% 120
100% 132 (longest request)
49 / 57
Problems
50 / 57
Problems
Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions.
51 / 57
Problems
Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions.
you have to recompile mRuby each time you add some dependency
52 / 57
Problems
Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions.
you have to recompile mRuby each time you add some dependency
oftenly gems are written in pure C
53 / 57
Problems
Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions.
you have to recompile mRuby each time you add some dependency
oftenly gems are written in pure C
mRuby has no require keyword, so you code will not be so DRY as you
want
54 / 57
Problems
Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions.
you have to recompile mRuby each time you add some dependency
oftenly gems are written in pure C
mRuby has no require keyword, so you code will not be so DRY as you
want
still not so fast as pure C implementation :(
55 / 57
Questions?
56 / 57
Thank you!
57 / 57
Lightweight APIs in mRuby

More Related Content

Viewers also liked

Overcommit for #pivorak
Overcommit for #pivorak Overcommit for #pivorak
Overcommit for #pivorak
Pivorak MeetUp
 
GIS on Rails
GIS on RailsGIS on Rails
GIS on Rails
Pivorak MeetUp
 
Building Web-API without Rails, Registration or SMS
Building Web-API without Rails, Registration or SMSBuilding Web-API without Rails, Registration or SMS
Building Web-API without Rails, Registration or SMS
Pivorak MeetUp
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, Lviv
Andrzej Krzywda
 
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
Detective story of one clever user - Lightning Talk By Sergiy KukuninDetective story of one clever user - Lightning Talk By Sergiy Kukunin
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
Pivorak MeetUp
 
UDD: building polyglot anti-framework by Marek Piasecki
UDD: building polyglot anti-framework by Marek PiaseckiUDD: building polyglot anti-framework by Marek Piasecki
UDD: building polyglot anti-framework by Marek Piasecki
Pivorak MeetUp
 
Functional Immutable CSS
Functional Immutable CSS Functional Immutable CSS
Functional Immutable CSS
Pivorak MeetUp
 
Digital Nomading on Rails
Digital Nomading on RailsDigital Nomading on Rails
Digital Nomading on Rails
Pivorak MeetUp
 
Pivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro BignyakPivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro Bignyak
Pivorak MeetUp
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick Sutterer
Pivorak MeetUp
 
Building component based rails applications. part 1.
Building component based rails applications. part 1.Building component based rails applications. part 1.
Building component based rails applications. part 1.
Pivorak MeetUp
 
The Silver Bullet Syndrome by Alexey Vasiliev
The Silver Bullet Syndrome by Alexey VasilievThe Silver Bullet Syndrome by Alexey Vasiliev
The Silver Bullet Syndrome by Alexey Vasiliev
Pivorak MeetUp
 
"Ruby meets Event Sourcing" by Anton Paisov
"Ruby meets Event Sourcing" by Anton Paisov"Ruby meets Event Sourcing" by Anton Paisov
"Ruby meets Event Sourcing" by Anton Paisov
Pivorak MeetUp
 
Espec |> Elixir BDD
Espec |> Elixir BDDEspec |> Elixir BDD
Espec |> Elixir BDD
Pivorak MeetUp
 
Права інтелектуальної власності в IT сфері.
Права інтелектуальної власності  в IT сфері.Права інтелектуальної власності  в IT сфері.
Права інтелектуальної власності в IT сфері.
Pivorak MeetUp
 
"5 skills to master" by Alexander Skakunov
"5 skills to master" by Alexander Skakunov"5 skills to master" by Alexander Skakunov
"5 skills to master" by Alexander Skakunov
Pivorak MeetUp
 
Building Component Based Rails Applications. Part 2.
Building Component Based Rails Applications. Part 2.Building Component Based Rails Applications. Part 2.
Building Component Based Rails Applications. Part 2.
Pivorak MeetUp
 
Andriy Vandakurov about "Frontend. Global domination"
Andriy Vandakurov about  "Frontend. Global domination" Andriy Vandakurov about  "Frontend. Global domination"
Andriy Vandakurov about "Frontend. Global domination"
Pivorak MeetUp
 
“Object Oriented Ruby” by Michał Papis.
“Object Oriented Ruby” by Michał Papis.“Object Oriented Ruby” by Michał Papis.
“Object Oriented Ruby” by Michał Papis.
Pivorak MeetUp
 
"Meet rom_rb & dry_rb" by Piotr Solnica
"Meet rom_rb & dry_rb" by Piotr Solnica"Meet rom_rb & dry_rb" by Piotr Solnica
"Meet rom_rb & dry_rb" by Piotr Solnica
Pivorak MeetUp
 

Viewers also liked (20)

Overcommit for #pivorak
Overcommit for #pivorak Overcommit for #pivorak
Overcommit for #pivorak
 
GIS on Rails
GIS on RailsGIS on Rails
GIS on Rails
 
Building Web-API without Rails, Registration or SMS
Building Web-API without Rails, Registration or SMSBuilding Web-API without Rails, Registration or SMS
Building Web-API without Rails, Registration or SMS
 
From Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, LvivFrom Rails legacy to DDD - Pivorak, Lviv
From Rails legacy to DDD - Pivorak, Lviv
 
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
Detective story of one clever user - Lightning Talk By Sergiy KukuninDetective story of one clever user - Lightning Talk By Sergiy Kukunin
Detective story of one clever user - Lightning Talk By Sergiy Kukunin
 
UDD: building polyglot anti-framework by Marek Piasecki
UDD: building polyglot anti-framework by Marek PiaseckiUDD: building polyglot anti-framework by Marek Piasecki
UDD: building polyglot anti-framework by Marek Piasecki
 
Functional Immutable CSS
Functional Immutable CSS Functional Immutable CSS
Functional Immutable CSS
 
Digital Nomading on Rails
Digital Nomading on RailsDigital Nomading on Rails
Digital Nomading on Rails
 
Pivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro BignyakPivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro Bignyak
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick Sutterer
 
Building component based rails applications. part 1.
Building component based rails applications. part 1.Building component based rails applications. part 1.
Building component based rails applications. part 1.
 
The Silver Bullet Syndrome by Alexey Vasiliev
The Silver Bullet Syndrome by Alexey VasilievThe Silver Bullet Syndrome by Alexey Vasiliev
The Silver Bullet Syndrome by Alexey Vasiliev
 
"Ruby meets Event Sourcing" by Anton Paisov
"Ruby meets Event Sourcing" by Anton Paisov"Ruby meets Event Sourcing" by Anton Paisov
"Ruby meets Event Sourcing" by Anton Paisov
 
Espec |> Elixir BDD
Espec |> Elixir BDDEspec |> Elixir BDD
Espec |> Elixir BDD
 
Права інтелектуальної власності в IT сфері.
Права інтелектуальної власності  в IT сфері.Права інтелектуальної власності  в IT сфері.
Права інтелектуальної власності в IT сфері.
 
"5 skills to master" by Alexander Skakunov
"5 skills to master" by Alexander Skakunov"5 skills to master" by Alexander Skakunov
"5 skills to master" by Alexander Skakunov
 
Building Component Based Rails Applications. Part 2.
Building Component Based Rails Applications. Part 2.Building Component Based Rails Applications. Part 2.
Building Component Based Rails Applications. Part 2.
 
Andriy Vandakurov about "Frontend. Global domination"
Andriy Vandakurov about  "Frontend. Global domination" Andriy Vandakurov about  "Frontend. Global domination"
Andriy Vandakurov about "Frontend. Global domination"
 
“Object Oriented Ruby” by Michał Papis.
“Object Oriented Ruby” by Michał Papis.“Object Oriented Ruby” by Michał Papis.
“Object Oriented Ruby” by Michał Papis.
 
"Meet rom_rb & dry_rb" by Piotr Solnica
"Meet rom_rb & dry_rb" by Piotr Solnica"Meet rom_rb & dry_rb" by Piotr Solnica
"Meet rom_rb & dry_rb" by Piotr Solnica
 

Similar to Lightweight APIs in mRuby

OSCon - Performance vs Scalability
OSCon - Performance vs ScalabilityOSCon - Performance vs Scalability
OSCon - Performance vs Scalability
Gleicon Moraes
 
Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0
Yann-Gaël Guéhéneuc
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
Nir Noy
 
Pareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo CollinaPareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo Collina
Wey Wey Web
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
Xebia IT Architects
 
Dipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application DevelopmentDipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application Development
Matthew Farina
 
Concurrency in ruby
Concurrency in rubyConcurrency in ruby
Concurrency in ruby
Marco Borromeo
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
Hiroshi SHIBATA
 
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсКирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
ScrumTrek
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtime
Lee Calcote
 
Node js
Node jsNode js
Node js
Chirag Parmar
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
Geison Goes
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
Mediafly
 
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019
Jamie Coleman
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
Mo'ath Qasim
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
Yuri Visser
 
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
chrisshattuck
 
Understanding and building Your Own Docker
Understanding and building Your Own DockerUnderstanding and building Your Own Docker
Understanding and building Your Own Docker
Motiejus Jakštys
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
Yusuke Ando
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJS
Dicoding
 

Similar to Lightweight APIs in mRuby (20)

OSCon - Performance vs Scalability
OSCon - Performance vs ScalabilityOSCon - Performance vs Scalability
OSCon - Performance vs Scalability
 
Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
 
Pareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo CollinaPareto will tell you to stop using your ORM - Mateo Collina
Pareto will tell you to stop using your ORM - Mateo Collina
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
 
Dipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application DevelopmentDipping Your Toes Into Cloud Native Application Development
Dipping Your Toes Into Cloud Native Application Development
 
Concurrency in ruby
Concurrency in rubyConcurrency in ruby
Concurrency in ruby
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсКирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtime
 
Node js
Node jsNode js
Node js
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
 
Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019Are you ready for cloud-native java JavaCro2019
Are you ready for cloud-native java JavaCro2019
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
 
Understanding and building Your Own Docker
Understanding and building Your Own DockerUnderstanding and building Your Own Docker
Understanding and building Your Own Docker
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJS
 

More from Pivorak MeetUp

Lisp(Lots of Irritating Superfluous Parentheses)
Lisp(Lots of Irritating Superfluous Parentheses)Lisp(Lots of Irritating Superfluous Parentheses)
Lisp(Lots of Irritating Superfluous Parentheses)
Pivorak MeetUp
 
Some strange stories about mocks.
Some strange stories about mocks.Some strange stories about mocks.
Some strange stories about mocks.
Pivorak MeetUp
 
Business-friendly library for inter-service communication
Business-friendly library for inter-service communicationBusiness-friendly library for inter-service communication
Business-friendly library for inter-service communication
Pivorak MeetUp
 
How i was a team leader once
How i was a team leader onceHow i was a team leader once
How i was a team leader once
Pivorak MeetUp
 
Rails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiRails MVC by Sergiy Koshovyi
Rails MVC by Sergiy Koshovyi
Pivorak MeetUp
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
 
Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)
Pivorak MeetUp
 
Testing in Ruby
Testing in RubyTesting in Ruby
Testing in Ruby
Pivorak MeetUp
 
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Ruby Summer Course by #pivorak & OnApp - OOP Basics in RubyRuby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Pivorak MeetUp
 
The Saga Pattern: 2 years later by Robert Pankowecki
The Saga Pattern: 2 years later by Robert PankoweckiThe Saga Pattern: 2 years later by Robert Pankowecki
The Saga Pattern: 2 years later by Robert Pankowecki
Pivorak MeetUp
 
Data and Bounded Contexts by Volodymyr Byno
Data and Bounded Contexts by Volodymyr BynoData and Bounded Contexts by Volodymyr Byno
Data and Bounded Contexts by Volodymyr Byno
Pivorak MeetUp
 
Successful Remote Development by Alex Rozumii
Successful Remote Development by Alex RozumiiSuccessful Remote Development by Alex Rozumii
Successful Remote Development by Alex Rozumii
Pivorak MeetUp
 
Origins of Elixir programming language
Origins of Elixir programming languageOrigins of Elixir programming language
Origins of Elixir programming language
Pivorak MeetUp
 
Multi language FBP with Flowex by Anton Mishchuk
Multi language FBP with Flowex by Anton Mishchuk Multi language FBP with Flowex by Anton Mishchuk
Multi language FBP with Flowex by Anton Mishchuk
Pivorak MeetUp
 
CryptoParty: Introduction by Olexii Markovets
CryptoParty: Introduction by Olexii MarkovetsCryptoParty: Introduction by Olexii Markovets
CryptoParty: Introduction by Olexii Markovets
Pivorak MeetUp
 
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
How to make first million by 30 (or not, but tryin') - by Marek PiaseckiHow to make first million by 30 (or not, but tryin') - by Marek Piasecki
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
Pivorak MeetUp
 
GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun
Pivorak MeetUp
 
Unikernels - Keep It Simple to the Bare Metal
Unikernels - Keep It Simple to the Bare MetalUnikernels - Keep It Simple to the Bare Metal
Unikernels - Keep It Simple to the Bare Metal
Pivorak MeetUp
 
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
 HTML Canvas tips & tricks - Lightning Talk by Roman Rodych HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
Pivorak MeetUp
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
Pivorak MeetUp
 

More from Pivorak MeetUp (20)

Lisp(Lots of Irritating Superfluous Parentheses)
Lisp(Lots of Irritating Superfluous Parentheses)Lisp(Lots of Irritating Superfluous Parentheses)
Lisp(Lots of Irritating Superfluous Parentheses)
 
Some strange stories about mocks.
Some strange stories about mocks.Some strange stories about mocks.
Some strange stories about mocks.
 
Business-friendly library for inter-service communication
Business-friendly library for inter-service communicationBusiness-friendly library for inter-service communication
Business-friendly library for inter-service communication
 
How i was a team leader once
How i was a team leader onceHow i was a team leader once
How i was a team leader once
 
Rails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiRails MVC by Sergiy Koshovyi
Rails MVC by Sergiy Koshovyi
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
 
Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)
 
Testing in Ruby
Testing in RubyTesting in Ruby
Testing in Ruby
 
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Ruby Summer Course by #pivorak & OnApp - OOP Basics in RubyRuby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
Ruby Summer Course by #pivorak & OnApp - OOP Basics in Ruby
 
The Saga Pattern: 2 years later by Robert Pankowecki
The Saga Pattern: 2 years later by Robert PankoweckiThe Saga Pattern: 2 years later by Robert Pankowecki
The Saga Pattern: 2 years later by Robert Pankowecki
 
Data and Bounded Contexts by Volodymyr Byno
Data and Bounded Contexts by Volodymyr BynoData and Bounded Contexts by Volodymyr Byno
Data and Bounded Contexts by Volodymyr Byno
 
Successful Remote Development by Alex Rozumii
Successful Remote Development by Alex RozumiiSuccessful Remote Development by Alex Rozumii
Successful Remote Development by Alex Rozumii
 
Origins of Elixir programming language
Origins of Elixir programming languageOrigins of Elixir programming language
Origins of Elixir programming language
 
Multi language FBP with Flowex by Anton Mishchuk
Multi language FBP with Flowex by Anton Mishchuk Multi language FBP with Flowex by Anton Mishchuk
Multi language FBP with Flowex by Anton Mishchuk
 
CryptoParty: Introduction by Olexii Markovets
CryptoParty: Introduction by Olexii MarkovetsCryptoParty: Introduction by Olexii Markovets
CryptoParty: Introduction by Olexii Markovets
 
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
How to make first million by 30 (or not, but tryin') - by Marek PiaseckiHow to make first million by 30 (or not, but tryin') - by Marek Piasecki
How to make first million by 30 (or not, but tryin') - by Marek Piasecki
 
GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun GIS on Rails by Oleksandr Kychun
GIS on Rails by Oleksandr Kychun
 
Unikernels - Keep It Simple to the Bare Metal
Unikernels - Keep It Simple to the Bare MetalUnikernels - Keep It Simple to the Bare Metal
Unikernels - Keep It Simple to the Bare Metal
 
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
 HTML Canvas tips & tricks - Lightning Talk by Roman Rodych HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
HTML Canvas tips & tricks - Lightning Talk by Roman Rodych
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
 

Recently uploaded

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
sandeepmenon62
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
widenerjobeyrl638
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 

Recently uploaded (20)

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptxOperational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
Operational ease MuleSoft and Salesforce Service Cloud Solution v1.0.pptx
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 

Lightweight APIs in mRuby

  • 1. Lightweight APIs in mRuby 1 / 57
  • 2. Who am I 2 / 57
  • 3. Who am I Name's Mikhail Bortnyk 3 / 57
  • 4. Who am I Name's Mikhail Bortnyk Ruby developer and team leader in R&R Music Ukraine 4 / 57
  • 5. Who am I Name's Mikhail Bortnyk Ruby developer and team leader in R&R Music Ukraine Co-creator of Kottans school 5 / 57
  • 6. Who am I Name's Mikhail Bortnyk Ruby developer and team leader in R&R Music Ukraine Co-creator of Kottans school Geek, polyglot, software development addict 6 / 57
  • 7. Who am I Name's Mikhail Bortnyk Ruby developer and team leader in R&R Music Ukraine Co-creator of Kottans school Geek, polyglot, software development addict github: @vessi 7 / 57
  • 8. Who am I Name's Mikhail Bortnyk Ruby developer and team leader in R&R Music Ukraine Co-creator of Kottans school Geek, polyglot, software development addict github: @vessi twitter: @mikhailbortnyk 8 / 57
  • 10. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 10 / 57
  • 11. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 can be linked and embedded into your application 11 / 57
  • 12. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 can be linked and embedded into your application can compile your software into bytecode 12 / 57
  • 13. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 can be linked and embedded into your application can compile your software into bytecode can generate C code for embedding bytecode 13 / 57
  • 14. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 can be linked and embedded into your application can compile your software into bytecode can generate C code for embedding bytecode author: Yukihiro 'matz' Matsumoto 14 / 57
  • 15. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 can be linked and embedded into your application can compile your software into bytecode can generate C code for embedding bytecode author: Yukihiro 'matz' Matsumoto github: github://mruby/mruby 15 / 57
  • 16. What is mRuby mRuby is lightweight implementation of Ruby complying (partially) to ISO/IEC 30170:2012 can be linked and embedded into your application can compile your software into bytecode can generate C code for embedding bytecode author: Yukihiro 'matz' Matsumoto github: github://mruby/mruby latest version: 1.1.0 16 / 57
  • 18. Typical Rails project (I am so sorry for it, mom!) 18 / 57
  • 19. Typical Rails project it's based on Rack 19 / 57
  • 20. Typical Rails project it's based on Rack it contains a lot of business processes 20 / 57
  • 21. Typical Rails project it's based on Rack it contains a lot of business processes it responds to many routes 21 / 57
  • 22. Typical Rails project it's based on Rack it contains a lot of business processes it responds to many routes often too heavy to serve tons of lightweight requests without scaling 22 / 57
  • 23. Typical Rails project it's based on Rack it contains a lot of business processes it responds to many routes often too heavy to serve tons of lightweight requests without scaling So, what is the solution? 23 / 57
  • 25. Solutions You have a problem and decide to use threads. Two now problems have you. 25 / 57
  • 26. Solutions You have a problem and decide to use threads. Two now problems have you. You have a problem and decide to use functional languages. Now your problems are immutable. 26 / 57
  • 27. Solutions You have a problem and decide to use threads. Two now problems have you. You have a problem and decide to use functional languages. Now your problems are immutable. You have a problem and decide to use Java. Now you have ProblemsFactory. 27 / 57
  • 28. Solutions You have a problem and decide to use threads. Two now problems have you. You have a problem and decide to use functional languages. Now your problems are immutable. You have a problem and decide to use Java. Now you have ProblemsFactory. You have a problem and decide... 28 / 57
  • 29. Kill it with fire! 29 / 57
  • 30. Kill it with fire! Microservices 30 / 57
  • 33. Microservices The idea is to split big project in bunch of independent lightweight services. 33 / 57
  • 34. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: 34 / 57
  • 35. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast 35 / 57
  • 36. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast be lightweight 36 / 57
  • 37. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast be lightweight be stable 37 / 57
  • 38. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast be lightweight be stable don't switch technology stack aggresively 38 / 57
  • 39. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast be lightweight be stable don't switch technology stack aggresively So, I decided to use mRuby. What do we have for serving web here? 39 / 57
  • 40. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast be lightweight be stable don't switch technology stack aggresively So, I decided to use mRuby. What do we have for serving web here? mod_mruby. Apache module that executes mRuby code inside Apache process. 40 / 57
  • 41. Microservices The idea is to split big project in bunch of independent lightweight services. Requirements: be fast be lightweight be stable don't switch technology stack aggresively So, I decided to use mRuby. What do we have for serving web here? mod_mruby. Apache module that executes mRuby code inside Apache process. ngx_mruby. Perfectly the same but with Nginx flavour. 41 / 57
  • 43. Little demonstration Used software: nginx (ALL) docker (ALL) docker-compose (ALL) mongodb (ALL) ab (ALL) unicorn gem (rack) rack gem (rack) rack-routing gem (rack) mongo gem (rack) ngx_mruby (mRuby) mruby-mongo (mRuby) 43 / 57
  • 44. Rack execution $> cd testlab/rack $> docker-compose up $> ab -n 10000 -c 100 http://192.168.0.100:10080/api/contacts # and kill docker-compose with ^C 44 / 57
  • 45. Rack stats (page 1) Document Path: /api/contacts Document Length: 537 bytes Concurrency Level: 100 Time taken for tests: 7.897 seconds Complete requests: 10000 Failed requests: 4399 (Connect: 0, Receive: 0, Length: 4399, Exceptions: 0) Non-2xx responses: 5601 Total transferred: 5080859 bytes HTML transferred: 3434440 bytes Requests per second: 1266.27 [#/sec] (mean) Time per request: 78.972 [ms] (mean) Time per request: 0.790 [ms] (mean, across all concurrent requests) Transfer rate: 628.29 [Kbytes/sec] received 45 / 57
  • 46. Rack stats (page 2) Connection Times (ms) min mean[+/-sd] median max Connect: 0 4 4.1 2 34 Processing: 1 74 72.1 23 423 Waiting: 1 74 72.0 22 423 Total: 2 78 72.2 27 426 Percentage of the requests served within a certain time (ms) 50% 27 66% 135 75% 147 80% 154 90% 174 95% 192 98% 216 99% 232 100% 426 (longest request) 46 / 57
  • 47. mRuby execution $> cd testlab/rack $> docker-compose up $> ab -n 10000 -c 100 http://192.168.0.100:10080/api/contacts # and kill docker-compose with ^C 47 / 57
  • 48. mRuby stats (page 1) Document Path: /api/contacts Document Length: 98 bytes Concurrency Level: 100 Time taken for tests: 6.721 seconds Complete requests: 10000 Failed requests: 0 Total transferred: 2140000 bytes HTML transferred: 980000 bytes Requests per second: 1487.83 [#/sec] (mean) Time per request: 67.212 [ms] (mean) Time per request: 0.672 [ms] (mean, across all concurrent requests) Transfer rate: 310.93 [Kbytes/sec] received 48 / 57
  • 49. mRuby stats (page 2) Connection Times (ms) min mean[+/-sd] median max Connect: 0 3 5.9 0 29 Processing: 5 64 27.5 68 132 Waiting: 5 64 27.6 68 131 Total: 14 67 24.4 69 132 Percentage of the requests served within a certain time (ms) 50% 69 66% 78 75% 83 80% 88 90% 102 95% 106 98% 112 99% 120 100% 132 (longest request) 49 / 57
  • 51. Problems Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions. 51 / 57
  • 52. Problems Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions. you have to recompile mRuby each time you add some dependency 52 / 57
  • 53. Problems Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions. you have to recompile mRuby each time you add some dependency oftenly gems are written in pure C 53 / 57
  • 54. Problems Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions. you have to recompile mRuby each time you add some dependency oftenly gems are written in pure C mRuby has no require keyword, so you code will not be so DRY as you want 54 / 57
  • 55. Problems Everything has its price. ngx_mruby and Nginx and mRuby are not exceptions. you have to recompile mRuby each time you add some dependency oftenly gems are written in pure C mRuby has no require keyword, so you code will not be so DRY as you want still not so fast as pure C implementation :( 55 / 57