SlideShare ist ein Scribd-Unternehmen logo
1 von 18
PHP vs NodeJS
Saumya Rastogi
Raghav Garg
Traditional Web Technologies vs NodeJS
PHP is a server-side scripting language designed for web development but also used as a general-purpose
programming language.
Originally created by Rasmus Lerdorf in 1994, the PHP reference implementation is now produced by
The PHP Group.
PHP originally stood for Personal Home Page, but it now stands for the recursive backronym PHP:
Hypertext Preprocessor
● Node.js is an open-source, cross-platform JavaScript run-time environment for executing
JavaScript code on server-side.
● It was originally written by Ryan Dahl in 2009.
● It is built by combining Google's V8 JavaScript engine, an event loop, and a low-level I/O API
● Dahl was inspired to create Node.js after seeing a file upload progress bar on Flickr
Companies
Using PHP
Companies
Using NodeJS
Benchmarking comparison between PHP & NodeJS
Understanding the concept
Why NodeJS?
Traditionally for each connection (request) we
spawns a new thread, taking up system RAM
and eventually maxing-out at the amount of
RAM.
Node.js operates on a single-thread, using
non-blocking I/O calls, allowing it to support
tens of thousands of concurrent connections
(held in the event loop).
NodeJS in brief
● Server side Javascript
● Built on Google’s V8 Engine
● Event driven, non blocking I/O
● CommonJS module system
● 8000 lines of C, C++ Code (at the time of release)
● 2000 lines of Javascript (at the time of release)
● 14 Contributors (at the time of release)
NodeJS equals to
Code written in C,
providing some
functionalities to
make a server
Javascript Runtime
Environment
+
Some more JS
code and some
library like
CommonJS
+
WHY?
because JS is a
Single Threaded
Non Blocking
Asynchronous
Concurrent
language
Single Threaded
Non Blocking
Asynchronous
Concurrent
The process goes into the worker thread, does a task as come back when its work is
done.
But how do they magically re-appear in the main thread.
There is a queue, which is maintained to store which worker thread is completed.
Now there is a dedicated worker thread, whose work is to constantly ping the queue
to check is some new task is completed. If there is a callback in the queue it then
checks the main thread if its idle then pass the callback to run else if busy then wait
for it be to get freed.
This dedicated worker thread is known as Event Loop.
Lets see it in working, Loupe
Coding Style
● PHP
○ As we’re all familiar with PHP’s coding style and we know that its very linear. Trying to multitask in PHP is a
schlep.
○ As we go on writing code, a developer knows that the flow for processing that particular code will be same as
its written (line-by-line).
● NodeJS
○ The major advantage here is asynchronous. Pretty much everything is multitasking.
○ Due to this, a developer must write the code in such a style so that he/she can handle the requests made by
multiple clients efficiently.
Working of PHP vs NodeJS
Working of PHP vs NodeJS
PHP NodeJS
Package Manager NPM
Popular Frameworks
ORM SQL: Eloquent
Mongo: null
SQL: BookshelfJS(KnexJS)
Mongo: Mongoose
Templating Engine Blade Express Handlebars, EJS
Debugging Whoops Node Inspector, App Logs
Testing PHP Unit Mocha, Chai, Assert
Rising
popularity &
usage of
Javascript

Weitere ähnliche Inhalte

Was ist angesagt?

The art of concurrent programming
The art of concurrent programmingThe art of concurrent programming
The art of concurrent programmingIskren Chernev
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascriptAndrei Sebastian Cîmpean
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming LanguageAdler Hsieh
 
Rubinius - Ruby Implemented with Ruby
Rubinius - Ruby Implemented with RubyRubinius - Ruby Implemented with Ruby
Rubinius - Ruby Implemented with RubyAkanksha Agrawal
 
Groovy / comparison with java
Groovy / comparison with javaGroovy / comparison with java
Groovy / comparison with javaLiviu Tudor
 
TypeScript 101 - Studio Session - Accenture Liquid Studio
TypeScript 101 - Studio Session - Accenture Liquid StudioTypeScript 101 - Studio Session - Accenture Liquid Studio
TypeScript 101 - Studio Session - Accenture Liquid StudioFrances Coronel
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in osGenchiLu1
 
A brief intro to RubyMotion
A brief intro to RubyMotionA brief intro to RubyMotion
A brief intro to RubyMotionKamil Lelonek
 
Php under the_hood
Php under the_hoodPhp under the_hood
Php under the_hoodfrank_neff
 
Writing NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in HaskellWriting NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in HaskellKiwamu Okabe
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersRutenis Turcinas
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devopsRob Kinyon
 
Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programmingkanteshraj
 
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)
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperlnohuhu
 

Was ist angesagt? (20)

The art of concurrent programming
The art of concurrent programmingThe art of concurrent programming
The art of concurrent programming
 
Crystal
CrystalCrystal
Crystal
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascript
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming Language
 
Rubinius - Ruby Implemented with Ruby
Rubinius - Ruby Implemented with RubyRubinius - Ruby Implemented with Ruby
Rubinius - Ruby Implemented with Ruby
 
Groovy / comparison with java
Groovy / comparison with javaGroovy / comparison with java
Groovy / comparison with java
 
TypeScript 101 - Studio Session - Accenture Liquid Studio
TypeScript 101 - Studio Session - Accenture Liquid StudioTypeScript 101 - Studio Session - Accenture Liquid Studio
TypeScript 101 - Studio Session - Accenture Liquid Studio
 
Scala vs ruby
Scala vs rubyScala vs ruby
Scala vs ruby
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
 
A brief intro to RubyMotion
A brief intro to RubyMotionA brief intro to RubyMotion
A brief intro to RubyMotion
 
Php under the_hood
Php under the_hoodPhp under the_hood
Php under the_hood
 
Writing NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in HaskellWriting NetBSD Sound Drivers in Haskell
Writing NetBSD Sound Drivers in Haskell
 
Sculpin
SculpinSculpin
Sculpin
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack Developers
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Beginning python programming
Beginning python programmingBeginning python programming
Beginning python programming
 
Always be testing
Always be testingAlways be testing
Always be testing
 
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
 
hexMachina WWX 2016
hexMachina WWX 2016hexMachina WWX 2016
hexMachina WWX 2016
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
 

Ähnlich wie PHP vs Node.js

PHP Vs NodeJS for Backend Web Development.pdf
PHP Vs NodeJS for Backend Web Development.pdfPHP Vs NodeJS for Backend Web Development.pdf
PHP Vs NodeJS for Backend Web Development.pdfSofiaCarter4
 
Node.Js vs PHP Which One Should You Choose.pdf
Node.Js vs PHP Which One Should You Choose.pdfNode.Js vs PHP Which One Should You Choose.pdf
Node.Js vs PHP Which One Should You Choose.pdfWPWeb Infotech
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfMindfire LLC
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdfDarshanaMallick
 
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
 
PHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and SimilaritiesPHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and SimilaritiesCloud Analogy
 
Exploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsExploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsEmma Thompson
 
Node.Js Vs PHP: Which is Likely a Better Server Side Environment?
Node.Js Vs PHP: Which is Likely a Better Server Side Environment?Node.Js Vs PHP: Which is Likely a Better Server Side Environment?
Node.Js Vs PHP: Which is Likely a Better Server Side Environment?Believ-In Technologies
 
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?Pixel Crayons
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for startersBruce Li
 
Node.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdfNode.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdfMoonTechnolabsPvtLtd
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1ADARSH BHATT
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfTop 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfMoonTechnolabsPvtLtd
 
Swoole Meetup AFUP¨Montpellier 27/01/2021
Swoole   Meetup  AFUP¨Montpellier 27/01/2021Swoole   Meetup  AFUP¨Montpellier 27/01/2021
Swoole Meetup AFUP¨Montpellier 27/01/2021Julien Vinber
 

Ähnlich wie PHP vs Node.js (20)

PHP Vs NodeJS for Backend Web Development.pdf
PHP Vs NodeJS for Backend Web Development.pdfPHP Vs NodeJS for Backend Web Development.pdf
PHP Vs NodeJS for Backend Web Development.pdf
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
 
Nodejs
NodejsNodejs
Nodejs
 
Node.Js vs PHP Which One Should You Choose.pdf
Node.Js vs PHP Which One Should You Choose.pdfNode.Js vs PHP Which One Should You Choose.pdf
Node.Js vs PHP Which One Should You Choose.pdf
 
Node.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdfNode.js vs PHP, What should SMBs prefer for web development.pdf
Node.js vs PHP, What should SMBs prefer for web development.pdf
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
 
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
 
Nodejs
NodejsNodejs
Nodejs
 
PHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and SimilaritiesPHP and Node.js-Differences and Similarities
PHP and Node.js-Differences and Similarities
 
Exploring PHP's Built-in Functions
Exploring PHP's Built-in FunctionsExploring PHP's Built-in Functions
Exploring PHP's Built-in Functions
 
Node.Js Vs PHP: Which is Likely a Better Server Side Environment?
Node.Js Vs PHP: Which is Likely a Better Server Side Environment?Node.Js Vs PHP: Which is Likely a Better Server Side Environment?
Node.Js Vs PHP: Which is Likely a Better Server Side Environment?
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
 
Node.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdfNode.js vs PHP_ Which is a good choice for your project_.pdf
Node.js vs PHP_ Which is a good choice for your project_.pdf
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
 
Presentation php
Presentation phpPresentation php
Presentation php
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdfTop 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
 
Swoole Meetup AFUP¨Montpellier 27/01/2021
Swoole   Meetup  AFUP¨Montpellier 27/01/2021Swoole   Meetup  AFUP¨Montpellier 27/01/2021
Swoole Meetup AFUP¨Montpellier 27/01/2021
 

Mehr von Squareboat

Squareboat Deck
Squareboat DeckSquareboat Deck
Squareboat DeckSquareboat
 
Squareboat Branding Proposal
Squareboat Branding ProposalSquareboat Branding Proposal
Squareboat Branding ProposalSquareboat
 
Squareboat Product Foundation Process
Squareboat Product Foundation ProcessSquareboat Product Foundation Process
Squareboat Product Foundation ProcessSquareboat
 
Squareboat Culture Deck
Squareboat Culture DeckSquareboat Culture Deck
Squareboat Culture DeckSquareboat
 
Squareboat Design Portfolio
Squareboat Design PortfolioSquareboat Design Portfolio
Squareboat Design PortfolioSquareboat
 
Squareboat Crew Deck
Squareboat Crew DeckSquareboat Crew Deck
Squareboat Crew DeckSquareboat
 
High Performance Mysql - Friday Tech Talks at Squareboat
High Performance Mysql - Friday Tech Talks at SquareboatHigh Performance Mysql - Friday Tech Talks at Squareboat
High Performance Mysql - Friday Tech Talks at SquareboatSquareboat
 
CTA - Call to Attention
CTA - Call to AttentionCTA - Call to Attention
CTA - Call to AttentionSquareboat
 
Tech talk on Tailwind CSS
Tech talk on Tailwind CSSTech talk on Tailwind CSS
Tech talk on Tailwind CSSSquareboat
 
What’s New in Apple World - WWDC19
What’s New in Apple World - WWDC19What’s New in Apple World - WWDC19
What’s New in Apple World - WWDC19Squareboat
 
Tech Talk on Microservices at Squareboat
Tech Talk on Microservices at SquareboatTech Talk on Microservices at Squareboat
Tech Talk on Microservices at SquareboatSquareboat
 
Building Alexa Skills
Building Alexa SkillsBuilding Alexa Skills
Building Alexa SkillsSquareboat
 
Making Products to get users “Hooked”
Making Products to get users “Hooked”Making Products to get users “Hooked”
Making Products to get users “Hooked”Squareboat
 
Moving to Docker... Finally!
Moving to Docker... Finally!Moving to Docker... Finally!
Moving to Docker... Finally!Squareboat
 
Continuous Delivery process
Continuous Delivery processContinuous Delivery process
Continuous Delivery processSquareboat
 
HTML and CSS architecture for 2025
HTML and CSS architecture for 2025HTML and CSS architecture for 2025
HTML and CSS architecture for 2025Squareboat
 
The rise of Conversational User Interfaces
The rise of Conversational User Interfaces The rise of Conversational User Interfaces
The rise of Conversational User Interfaces Squareboat
 
Thinking of growth as a feature
Thinking of growth as a feature Thinking of growth as a feature
Thinking of growth as a feature Squareboat
 

Mehr von Squareboat (20)

Squareboat Deck
Squareboat DeckSquareboat Deck
Squareboat Deck
 
Squareboat Branding Proposal
Squareboat Branding ProposalSquareboat Branding Proposal
Squareboat Branding Proposal
 
Squareboat Product Foundation Process
Squareboat Product Foundation ProcessSquareboat Product Foundation Process
Squareboat Product Foundation Process
 
Squareboat Culture Deck
Squareboat Culture DeckSquareboat Culture Deck
Squareboat Culture Deck
 
Squareboat Design Portfolio
Squareboat Design PortfolioSquareboat Design Portfolio
Squareboat Design Portfolio
 
Squareboat Crew Deck
Squareboat Crew DeckSquareboat Crew Deck
Squareboat Crew Deck
 
High Performance Mysql - Friday Tech Talks at Squareboat
High Performance Mysql - Friday Tech Talks at SquareboatHigh Performance Mysql - Friday Tech Talks at Squareboat
High Performance Mysql - Friday Tech Talks at Squareboat
 
CTA - Call to Attention
CTA - Call to AttentionCTA - Call to Attention
CTA - Call to Attention
 
Tech talk on Tailwind CSS
Tech talk on Tailwind CSSTech talk on Tailwind CSS
Tech talk on Tailwind CSS
 
What’s New in Apple World - WWDC19
What’s New in Apple World - WWDC19What’s New in Apple World - WWDC19
What’s New in Apple World - WWDC19
 
Tech Talk on Microservices at Squareboat
Tech Talk on Microservices at SquareboatTech Talk on Microservices at Squareboat
Tech Talk on Microservices at Squareboat
 
Building Alexa Skills
Building Alexa SkillsBuilding Alexa Skills
Building Alexa Skills
 
Making Products to get users “Hooked”
Making Products to get users “Hooked”Making Products to get users “Hooked”
Making Products to get users “Hooked”
 
Moving to Docker... Finally!
Moving to Docker... Finally!Moving to Docker... Finally!
Moving to Docker... Finally!
 
Color Theory
Color TheoryColor Theory
Color Theory
 
Continuous Delivery process
Continuous Delivery processContinuous Delivery process
Continuous Delivery process
 
HTML and CSS architecture for 2025
HTML and CSS architecture for 2025HTML and CSS architecture for 2025
HTML and CSS architecture for 2025
 
Vue JS
Vue JSVue JS
Vue JS
 
The rise of Conversational User Interfaces
The rise of Conversational User Interfaces The rise of Conversational User Interfaces
The rise of Conversational User Interfaces
 
Thinking of growth as a feature
Thinking of growth as a feature Thinking of growth as a feature
Thinking of growth as a feature
 

Kürzlich hochgeladen

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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
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
 
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
 
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
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
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
 
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
 
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
 
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
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

PHP vs Node.js

  • 1. PHP vs NodeJS Saumya Rastogi Raghav Garg Traditional Web Technologies vs NodeJS
  • 2. PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. Originally created by Rasmus Lerdorf in 1994, the PHP reference implementation is now produced by The PHP Group. PHP originally stood for Personal Home Page, but it now stands for the recursive backronym PHP: Hypertext Preprocessor
  • 3. ● Node.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code on server-side. ● It was originally written by Ryan Dahl in 2009. ● It is built by combining Google's V8 JavaScript engine, an event loop, and a low-level I/O API ● Dahl was inspired to create Node.js after seeing a file upload progress bar on Flickr
  • 7. Why NodeJS? Traditionally for each connection (request) we spawns a new thread, taking up system RAM and eventually maxing-out at the amount of RAM. Node.js operates on a single-thread, using non-blocking I/O calls, allowing it to support tens of thousands of concurrent connections (held in the event loop).
  • 8. NodeJS in brief ● Server side Javascript ● Built on Google’s V8 Engine ● Event driven, non blocking I/O ● CommonJS module system ● 8000 lines of C, C++ Code (at the time of release) ● 2000 lines of Javascript (at the time of release) ● 14 Contributors (at the time of release)
  • 9. NodeJS equals to Code written in C, providing some functionalities to make a server Javascript Runtime Environment + Some more JS code and some library like CommonJS +
  • 10. WHY?
  • 11. because JS is a Single Threaded Non Blocking Asynchronous Concurrent language
  • 13. The process goes into the worker thread, does a task as come back when its work is done. But how do they magically re-appear in the main thread. There is a queue, which is maintained to store which worker thread is completed. Now there is a dedicated worker thread, whose work is to constantly ping the queue to check is some new task is completed. If there is a callback in the queue it then checks the main thread if its idle then pass the callback to run else if busy then wait for it be to get freed. This dedicated worker thread is known as Event Loop. Lets see it in working, Loupe
  • 14. Coding Style ● PHP ○ As we’re all familiar with PHP’s coding style and we know that its very linear. Trying to multitask in PHP is a schlep. ○ As we go on writing code, a developer knows that the flow for processing that particular code will be same as its written (line-by-line). ● NodeJS ○ The major advantage here is asynchronous. Pretty much everything is multitasking. ○ Due to this, a developer must write the code in such a style so that he/she can handle the requests made by multiple clients efficiently.
  • 15. Working of PHP vs NodeJS
  • 16. Working of PHP vs NodeJS
  • 17. PHP NodeJS Package Manager NPM Popular Frameworks ORM SQL: Eloquent Mongo: null SQL: BookshelfJS(KnexJS) Mongo: Mongoose Templating Engine Blade Express Handlebars, EJS Debugging Whoops Node Inspector, App Logs Testing PHP Unit Mocha, Chai, Assert