SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
CONTENTS
● Brief Description on:
1. Grape
2. Goliath
3. Eventmachine
4. Fiber
5. Node.JS
6. Node.JS vs EM
● Grape_Goliath Gem and Usage
GRAPE
● REST-like API micro-framework for
Ruby
● Designed to run on Rack or
complement existing web application
frameworks.
● Grape APIs are Rack applications
that are created by subclassing
Grape::API.
Advantages
● No need of rails to create simple
API's.
● Grape allows you to build lightweight
APIs with Ruby when you don't need
the heavy lifting power of large
frameworks like Rails.
GOLIATH
● Non-blocking Ruby web server
● Serves to requests using a
EventMachine loop.
● Uses a Fiber to process a request.
Significance of Goliath
● Bare metal performance
● Rack API and middleware support
● Simple configuration
● Fully asynchronous processing
● Readable and maintainable code
Goliath Advantage
● Major advantage over other frameworks is
that by leveraging Ruby fibers introduced
in Ruby 1.9+, it can untangle the
complicated callback-based code into a
known format.
● Linear execution, leads to more
maintainable and readable code.
..contd
● Each HTTP request within Goliath is
executed within its own Ruby fiber and all
asynchronous I/O operations can
transparently suspend and later resume
the processing without requiring the
developer to write any additional code.
● Both request processing and response
processing can be done in fully
asynchronous fashion:
streaming uploads, firehose API's,
request/response, websockets, and so on.
Goliath compared to
other servers like Thin
● Goliath is able to run on different Ruby
platforms.
● It uses a different HTTP parser, supports
HTTP keepalive & pipelining.
● Offers a fully asynchronous API for both
request and response processing.
..contd
● Goliath claims to works its magic by
“leveraging Ruby fibers introduced in Ruby
1.9+”.
● Fibers are primitives for implementing light
weight cooperative concurrency in Ruby.
Basically they are a means of creating
code blocks that can be paused and
resumed, much like threads.
● The main difference is that they are never
preempted and that the scheduling must
be done by the programmer.
EVENTMACHINE
● EventMachine is an event-driven I/O and
lightweight concurrency library for Ruby.
● It provides event-driven I/O using the
Reactor pattern, much like JBoss Netty,
Apache MINA, Python's Twisted, Node.js,
libevent and libev.
EM Significance
● Extremely high scalability, performance and
stability for the most demanding production
environments.
● An API that eliminates the complexities of
high-performance threaded network
programming, allowing engineers to
concentrate on their application logic.
● This unique combination makes
EventMachine a premier choice for critical
networked applications, including Web
servers and proxies, email and IM production
systems, authentication/authorization
processors, and many more.
EventMachine Usage
● Scalable event-driven servers. Examples:
Thin or Goliath.
● Scalable asynchronous clients for various
protocols, RESTful APIs and so on.
Examples: em-http-request or amqp gem.
● Efficient network proxies with custom
logic. Examples: Proxymachine.
● File and network monitoring tools.
Examples: eventmachine-tail and logstash.
FIBERS
● Primitives for implementing light weight
cooperative concurrency in Ruby.
● They are never preempted and that the
scheduling must be done by the
programmer and not the VM.
● Small 4KB stack enables it to be paused
from deeply nested function calls within
the fiber block.
● Run using the Fiber#resume method. The
code running inside the fiber can give up
control by calling Fiber.yield.
Client Example
Server Example
Node.JS vs EM
Pros and Cons
EM
● Clever DSL
● Also Fast
● Its Ruby
● Mature
● Restricted EM Libraries.
● More difficult to write
than normal ruby.
Node.JS
● Shared Code
betweeen Client
and Server.
● Lightning Fast
● Javascript used
● Callback Hell
● Less Mature.
EventMachine Better
than Node.JS?
YES
● EventMachine’s concurrent processing
ability is stronger than Node.js 50%.
● When request number goes up, Node.js’s
connection rate goes down.
Gem Grape_Goliath
●
Gem which creates an application with
tree structure specified for a Goliath
application having Grape API framework.
● Included Gems in tree structure :
grape, goliath, em_synchrony
● Added dependencies of rubigen included.
Basic tree structure
/config
Important Gems Used
Rubigen
● A framework to allow Ruby applications to
generate file/folder stubs.
● RubiGen will be normally integrated into
another RubyGem, such as newgem, rails or
camping.
● Here we have used newgem.
`` NewGem
● Quickly bundle any Ruby libraries into a
RubyGem and share it with the world.
Generators
● There are two types :
1. Application generators – Used by
developers for the framework to get started.
Generally used to generate a basic stub
directory files/folders.
2. Component generators - Used by
developers to extend their application.
● Here we have used application generator for
basic goliath app tree structure generation.
grape_goliath_generator.rb
● Application generator for the gem.
● Its manifest method includes the
directories that are to be created and the
files that should be inlcuded in the tree
structure.
● The files that should get added with
specified code are to be included in the
templates folder in the path
app/application_generator/grape_goliath
/templates.
Usage
● grape_goliath application_name
● cd application_name
● bundle install (To install all dependencies)
● ruby server.rb -vs (To run the Goliath server)
● For further info visit:
https://github.com/qburstruby/grape_goliath
Enjoy Grape_Goliath!!
Thank You

Más contenido relacionado

La actualidad más candente

From .Net to Rails, A developers story
From .Net to Rails, A developers storyFrom .Net to Rails, A developers story
From .Net to Rails, A developers storypythonandchips
 
appborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-systemappborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-systemendian7000
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptnohuhu
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolAlessandro Cinelli (cirpo)
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleHenryk Konsek
 
Modern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xModern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xThomas Segismont
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perlnohuhu
 
Background processes and tasks in an async world
Background processes and tasks in an async worldBackground processes and tasks in an async world
Background processes and tasks in an async worldparticlebanana
 
Marcelo Camargo - Let's dive into Babel: how everything works
Marcelo Camargo - Let's dive into Babel: how everything worksMarcelo Camargo - Let's dive into Babel: how everything works
Marcelo Camargo - Let's dive into Babel: how everything worksReact Conf Brasil
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?Hiroshi SHIBATA
 
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive appBASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive appHanaStevanovic
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/awaitC4Media
 
Return on Ignite 2019: Azure, .NET, A.I. & Data
Return on Ignite 2019: Azure, .NET, A.I. & DataReturn on Ignite 2019: Azure, .NET, A.I. & Data
Return on Ignite 2019: Azure, .NET, A.I. & DataMSDEVMTL
 
Minko - Build WebGL applications with C++ and asm.js
Minko - Build WebGL applications with C++ and asm.jsMinko - Build WebGL applications with C++ and asm.js
Minko - Build WebGL applications with C++ and asm.jsMinko3D
 
Onivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureOnivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureBryan Phelps
 
Java concurrency
Java concurrencyJava concurrency
Java concurrencyfbenault
 
The art of concurrent programming
The art of concurrent programmingThe art of concurrent programming
The art of concurrent programmingIskren Chernev
 

La actualidad más candente (20)

From .Net to Rails, A developers story
From .Net to Rails, A developers storyFrom .Net to Rails, A developers story
From .Net to Rails, A developers story
 
appborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-systemappborg, coffeesurgeon, moof, logging-system
appborg, coffeesurgeon, moof, logging-system
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
Ruby On Rails Ecosystem
Ruby On Rails EcosystemRuby On Rails Ecosystem
Ruby On Rails Ecosystem
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the fool
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
 
Modern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.xModern app programming with RxJava and Eclipse Vert.x
Modern app programming with RxJava and Eclipse Vert.x
 
20140918 ruby kaigi2014
20140918 ruby kaigi201420140918 ruby kaigi2014
20140918 ruby kaigi2014
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
 
Background processes and tasks in an async world
Background processes and tasks in an async worldBackground processes and tasks in an async world
Background processes and tasks in an async world
 
Marcelo Camargo - Let's dive into Babel: how everything works
Marcelo Camargo - Let's dive into Babel: how everything worksMarcelo Camargo - Let's dive into Babel: how everything works
Marcelo Camargo - Let's dive into Babel: how everything works
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
 
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive appBASICS OF VERT.X - A toolkit for building asynchronous and reactive app
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Return on Ignite 2019: Azure, .NET, A.I. & Data
Return on Ignite 2019: Azure, .NET, A.I. & DataReturn on Ignite 2019: Azure, .NET, A.I. & Data
Return on Ignite 2019: Azure, .NET, A.I. & Data
 
Minko - Build WebGL applications with C++ and asm.js
Minko - Build WebGL applications with C++ and asm.jsMinko - Build WebGL applications with C++ and asm.js
Minko - Build WebGL applications with C++ and asm.js
 
Onivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureOnivim: Modal Editing from the Future
Onivim: Modal Editing from the Future
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
From 'Legacy' to 'Edge'
From 'Legacy' to 'Edge'From 'Legacy' to 'Edge'
From 'Legacy' to 'Edge'
 
The art of concurrent programming
The art of concurrent programmingThe art of concurrent programming
The art of concurrent programming
 

Destacado

Театр в Таганроге
Театр в ТаганрогеТеатр в Таганроге
Театр в ТаганрогеNatalya Biryukova
 
Crime prevention via job creation
Crime prevention via job creationCrime prevention via job creation
Crime prevention via job creationGraham Nosworthy
 
Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653
Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653
Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653kimthoa3124
 
APRA presentation for inDegree 2012
APRA presentation for  inDegree 2012APRA presentation for  inDegree 2012
APRA presentation for inDegree 2012Molly Wasko
 
WPF - Controls & Data
WPF - Controls & DataWPF - Controls & Data
WPF - Controls & DataSharada Gururaj
 
Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653
Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653
Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653kimthoa3124
 
Mcpppt
McppptMcpppt
Mcppptjlweb
 
Nuevo album de silvia
Nuevo album de silviaNuevo album de silvia
Nuevo album de silviaRosana trosch
 
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39kimthoa3124
 
Căn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhà
Căn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhàCăn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhà
Căn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhàkimthoa3124
 
áLbum de fotografías
áLbum de fotografíasáLbum de fotografías
áLbum de fotografíasJüän Riveroz
 
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653kimthoa3124
 

Destacado (15)

Karla Munoz
Karla MunozKarla Munoz
Karla Munoz
 
Театр в Таганроге
Театр в ТаганрогеТеатр в Таганроге
Театр в Таганроге
 
Crime prevention via job creation
Crime prevention via job creationCrime prevention via job creation
Crime prevention via job creation
 
Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653
Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653
Sunview 3 trung tâm gò vấp chỉ 614tr căn lh 0989.707.653
 
APRA presentation for inDegree 2012
APRA presentation for  inDegree 2012APRA presentation for  inDegree 2012
APRA presentation for inDegree 2012
 
WPF - Controls & Data
WPF - Controls & DataWPF - Controls & Data
WPF - Controls & Data
 
Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653
Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653
Căn hộ sunview 3 trung tâm gò vấp chỉ 614 tr căn lh 0989.707.653
 
Mcpppt
McppptMcpppt
Mcpppt
 
Nuevo album de silvia
Nuevo album de silviaNuevo album de silvia
Nuevo album de silvia
 
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
Căn hộ phố đông 66 m2, 735tr, lh 0915.45.75.39
 
OlymFirst49
OlymFirst49OlymFirst49
OlymFirst49
 
Căn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhà
Căn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhàCăn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhà
Căn hộ phố đông giá gốc cđt 11.6tr m2, chuẩn bị giao nhà
 
áLbum de fotografías
áLbum de fotografíasáLbum de fotografías
áLbum de fotografías
 
PAT1#5203
PAT1#5203PAT1#5203
PAT1#5203
 
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653
CĂN HỘ SUNVIEW 3 TRUNG TÂM GÒ VẤP 614TR/CĂN LH 0989 707 653
 

Similar a Grape golilath

mRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentmRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentKazuhiro Koga 古賀一博
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...WebStackAcademy
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js PresentationExist
 
Highly Surmountable Challenges in Ruby+OMR JIT Compilation
Highly Surmountable Challenges in Ruby+OMR JIT CompilationHighly Surmountable Challenges in Ruby+OMR JIT Compilation
Highly Surmountable Challenges in Ruby+OMR JIT CompilationMatthew Gaudet
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsPostman
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystemGeison Goes
 
Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On Ram G Suri
 
Demystifying microservices for JavaEE developers by Steve Millidge.
Demystifying microservices for JavaEE developers by Steve Millidge.Demystifying microservices for JavaEE developers by Steve Millidge.
Demystifying microservices for JavaEE developers by Steve Millidge.Payara
 
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedis Labs
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopBob Killen
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJsAram Rafeq
 
Lua as a business logic language in high load application
Lua as a business logic language in high load applicationLua as a business logic language in high load application
Lua as a business logic language in high load applicationIlya Martynov
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kuberneteskloia
 
IDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionIDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionBrion Mario
 
Java Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreJava Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreGateway Software Solutions
 
Deep Dive into Node.js Event Loop.pdf
Deep Dive into Node.js Event Loop.pdfDeep Dive into Node.js Event Loop.pdf
Deep Dive into Node.js Event Loop.pdfShubhamChaurasia88
 

Similar a Grape golilath (20)

mRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System DevelopmentmRuby - Powerful Software for Embedded System Development
mRuby - Powerful Software for Embedded System Development
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js Presentation
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Highly Surmountable Challenges in Ruby+OMR JIT Compilation
Highly Surmountable Challenges in Ruby+OMR JIT CompilationHighly Surmountable Challenges in Ruby+OMR JIT Compilation
Highly Surmountable Challenges in Ruby+OMR JIT Compilation
 
Nodejs
NodejsNodejs
Nodejs
 
Apache James/Hupa & GWT
Apache James/Hupa & GWTApache James/Hupa & GWT
Apache James/Hupa & GWT
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIs
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
 
Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On
 
Demystifying microservices for JavaEE developers by Steve Millidge.
Demystifying microservices for JavaEE developers by Steve Millidge.Demystifying microservices for JavaEE developers by Steve Millidge.
Demystifying microservices for JavaEE developers by Steve Millidge.
 
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJs
 
Lua as a business logic language in high load application
Lua as a business logic language in high load applicationLua as a business logic language in high load application
Lua as a business logic language in high load application
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
IDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase SessionIDEALIZE 2023 - NodeJS & Firebase Session
IDEALIZE 2023 - NodeJS & Firebase Session
 
Java Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreJava Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,Coimbatore
 
Deep Dive into Node.js Event Loop.pdf
Deep Dive into Node.js Event Loop.pdfDeep Dive into Node.js Event Loop.pdf
Deep Dive into Node.js Event Loop.pdf
 

Último

9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 

Último (20)

20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 

Grape golilath

  • 1. CONTENTS ● Brief Description on: 1. Grape 2. Goliath 3. Eventmachine 4. Fiber 5. Node.JS 6. Node.JS vs EM ● Grape_Goliath Gem and Usage
  • 2. GRAPE ● REST-like API micro-framework for Ruby ● Designed to run on Rack or complement existing web application frameworks. ● Grape APIs are Rack applications that are created by subclassing Grape::API.
  • 3. Advantages ● No need of rails to create simple API's. ● Grape allows you to build lightweight APIs with Ruby when you don't need the heavy lifting power of large frameworks like Rails.
  • 4. GOLIATH ● Non-blocking Ruby web server ● Serves to requests using a EventMachine loop. ● Uses a Fiber to process a request.
  • 5. Significance of Goliath ● Bare metal performance ● Rack API and middleware support ● Simple configuration ● Fully asynchronous processing ● Readable and maintainable code
  • 6. Goliath Advantage ● Major advantage over other frameworks is that by leveraging Ruby fibers introduced in Ruby 1.9+, it can untangle the complicated callback-based code into a known format. ● Linear execution, leads to more maintainable and readable code.
  • 7. ..contd ● Each HTTP request within Goliath is executed within its own Ruby fiber and all asynchronous I/O operations can transparently suspend and later resume the processing without requiring the developer to write any additional code. ● Both request processing and response processing can be done in fully asynchronous fashion: streaming uploads, firehose API's, request/response, websockets, and so on.
  • 8. Goliath compared to other servers like Thin ● Goliath is able to run on different Ruby platforms. ● It uses a different HTTP parser, supports HTTP keepalive & pipelining. ● Offers a fully asynchronous API for both request and response processing.
  • 9. ..contd ● Goliath claims to works its magic by “leveraging Ruby fibers introduced in Ruby 1.9+”. ● Fibers are primitives for implementing light weight cooperative concurrency in Ruby. Basically they are a means of creating code blocks that can be paused and resumed, much like threads. ● The main difference is that they are never preempted and that the scheduling must be done by the programmer.
  • 10. EVENTMACHINE ● EventMachine is an event-driven I/O and lightweight concurrency library for Ruby. ● It provides event-driven I/O using the Reactor pattern, much like JBoss Netty, Apache MINA, Python's Twisted, Node.js, libevent and libev.
  • 11. EM Significance ● Extremely high scalability, performance and stability for the most demanding production environments. ● An API that eliminates the complexities of high-performance threaded network programming, allowing engineers to concentrate on their application logic. ● This unique combination makes EventMachine a premier choice for critical networked applications, including Web servers and proxies, email and IM production systems, authentication/authorization processors, and many more.
  • 12. EventMachine Usage ● Scalable event-driven servers. Examples: Thin or Goliath. ● Scalable asynchronous clients for various protocols, RESTful APIs and so on. Examples: em-http-request or amqp gem. ● Efficient network proxies with custom logic. Examples: Proxymachine. ● File and network monitoring tools. Examples: eventmachine-tail and logstash.
  • 13. FIBERS ● Primitives for implementing light weight cooperative concurrency in Ruby. ● They are never preempted and that the scheduling must be done by the programmer and not the VM. ● Small 4KB stack enables it to be paused from deeply nested function calls within the fiber block. ● Run using the Fiber#resume method. The code running inside the fiber can give up control by calling Fiber.yield.
  • 17. Pros and Cons EM ● Clever DSL ● Also Fast ● Its Ruby ● Mature ● Restricted EM Libraries. ● More difficult to write than normal ruby. Node.JS ● Shared Code betweeen Client and Server. ● Lightning Fast ● Javascript used ● Callback Hell ● Less Mature.
  • 18. EventMachine Better than Node.JS? YES ● EventMachine’s concurrent processing ability is stronger than Node.js 50%. ● When request number goes up, Node.js’s connection rate goes down.
  • 19. Gem Grape_Goliath ● Gem which creates an application with tree structure specified for a Goliath application having Grape API framework. ● Included Gems in tree structure : grape, goliath, em_synchrony ● Added dependencies of rubigen included.
  • 21. Important Gems Used Rubigen ● A framework to allow Ruby applications to generate file/folder stubs. ● RubiGen will be normally integrated into another RubyGem, such as newgem, rails or camping. ● Here we have used newgem. `` NewGem ● Quickly bundle any Ruby libraries into a RubyGem and share it with the world.
  • 22. Generators ● There are two types : 1. Application generators – Used by developers for the framework to get started. Generally used to generate a basic stub directory files/folders. 2. Component generators - Used by developers to extend their application. ● Here we have used application generator for basic goliath app tree structure generation.
  • 23. grape_goliath_generator.rb ● Application generator for the gem. ● Its manifest method includes the directories that are to be created and the files that should be inlcuded in the tree structure. ● The files that should get added with specified code are to be included in the templates folder in the path app/application_generator/grape_goliath /templates.
  • 24. Usage ● grape_goliath application_name ● cd application_name ● bundle install (To install all dependencies) ● ruby server.rb -vs (To run the Goliath server) ● For further info visit: https://github.com/qburstruby/grape_goliath