SlideShare una empresa de 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

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

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

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 

Último (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 

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