SlideShare a Scribd company logo
1 of 58
Download to read offline
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
 
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 SMSPivorak 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, LvivAndrzej 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 KukuninPivorak 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 PiaseckiPivorak 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 RailsPivorak MeetUp
 
Pivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro BignyakPivorak Clojure by Dmytro Bignyak
Pivorak Clojure by Dmytro BignyakPivorak MeetUp
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererPivorak 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 VasilievPivorak 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 PaisovPivorak 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 SkakunovPivorak 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 SolnicaPivorak 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 ScalabilityGleicon Moraes
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN StackNir 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 CollinaWey Wey Web
 
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 DevelopmentMatthew Farina
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
Кирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсКирилл Толкачев. Микросервисы: огонь, вода и девопс
Кирилл Толкачев. Микросервисы: огонь, вода и девопсScrumTrek
 
UniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeUniK - a unikernel compiler and runtime
UniK - a unikernel compiler and runtimeLee Calcote
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystemGeison Goes
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyMediafly
 
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 JavaCro2019Jamie Coleman
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in GolangMo'ath Qasim
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworksYuri 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 2014chrisshattuck
 
Understanding and building Your Own Docker
Understanding and building Your Own DockerUnderstanding and building Your Own Docker
Understanding and building Your Own DockerMotiejus Jakštys
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudyYusuke Ando
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJSDicoding
 
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitThe DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitMarco Ferrigno
 

Similar to Lightweight APIs in mRuby (20)

OSCon - Performance vs Scalability
OSCon - Performance vs ScalabilityOSCon - Performance vs Scalability
OSCon - Performance vs Scalability
 
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
 
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkitThe DevOps paradigm - the evolution of IT professionals and opensource toolkit
The DevOps paradigm - the evolution of IT professionals and opensource toolkit
 

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 communicationPivorak 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 oncePivorak MeetUp
 
Rails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiRails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiPivorak MeetUp
 
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukPivorak MeetUp
 
Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)Ruby OOP (in Ukrainian)
Ruby OOP (in Ukrainian)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 RubyPivorak 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 PankoweckiPivorak 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 BynoPivorak MeetUp
 
Successful Remote Development by Alex Rozumii
Successful Remote Development by Alex RozumiiSuccessful Remote Development by Alex Rozumii
Successful Remote Development by Alex RozumiiPivorak MeetUp
 
Origins of Elixir programming language
Origins of Elixir programming languageOrigins of Elixir programming language
Origins of Elixir programming languagePivorak 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 MarkovetsPivorak 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 PiaseckiPivorak 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 MetalPivorak 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 RodychPivorak MeetUp
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovPivorak 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

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

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