SlideShare uma empresa Scribd logo
1 de 25
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

Театр в Таганроге
Театр в ТаганрогеТеатр в Таганроге
Театр в Таганроге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
 

Destaque (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
 

Semelhante 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
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdfSonia Simi
 
Building Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsBuilding Cloud-agnostic Serverless APIs
Building Cloud-agnostic Serverless APIsPostman
 
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx75waytechnologies
 
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
 

Semelhante 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
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
 
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
 
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
 
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
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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