SlideShare a Scribd company logo
1 of 23
Download to read offline
REAL-TIME WEB
Medhat Dawoud
www.medhatdawoud.net
@Med7atDawoud
What is Real-time web
• The meaning is that: users can see the contents
as fast as the author publish it (like chat
applications)
• A lot of technologies are used to implement the
Real-time systems.
• Today I’m interested in a technology that do that
for us in an easy, reliable, and fantastic way
To create Real-time system on web we need ..
• Very fast web server.
• Very very fast I/O operations (Non-blocking).
• System that depend on event-driven(event-loops).
• Flexible tool to handle all of this in a simple way.
Some technologies for Real-time systems
Python [ twisted ]
Ruby [ EventMachine ]
Perl [ AnyEvent ]
If you deal with one of them, this presentation will be really understood at once.
Finally , The Magic Technology Appears
• 2009 - this guy “Ryan Dahl” releases something
that support the highly-performance
concurrent applications.
• It’s called Node.js
What is Node.js ?
• In simple words Node.js is ‘server-side JavaScript’.
• In not-so-simple words Node.js is a high-performance
network applications framework, well optimized for high
concurrent environments.
• It’s Open Source. It runs well on Linux systems, can
also run on Windows systems.
• uses an asynchronous event-driven model.
What is Node.js ?
• Built and run on V8 JavaScript engine.
• In ‘Node.js’ , ‘.js’ doesn’t mean that its solely written
JavaScript. It is 40% JS and 60% C++.
• is now the most followed project on Github,
exceeding Ruby on Rails .. woooooo
• From the official site:
‘Node's goal is to provide an easy way to build scalable
network programs’ - (from nodejs.org!)
Google V8 engine
• V8 is an open source JavaScript engine
developed by Google. It’s written in C++ and is
used in Google Chrome Browser.
• Faster than SpiderMonkey (used in firefox) over
4 times ( when V8 was invented ) 
- from an expert on stakoverflow -
Theory 1 : Event-loops
Event-loops are the core of event-driven programming, almost
all the UI programs use event-loops to track the user event, for
example: Clicks, Ajax Requests etc.
Client
Event loop
(main thread)
C++ Threadpool
(worker threads)
Clients send HTTP requests
to Node.js server
An Event-loop is woken up by OS,
passes request and response objects
to the thread-pool
Long-running jobs run
on worker threads
Response is sent
back to main thread
via callback
Event loop returns
result to client
Theory 2 : Non-blocking I/O
• Traditional I/O
var result = db.query(“select x from table_Y”);
doSomethingWith(result); //wait for result!
doSomethingWithOutResult(); //execution is blocked!
• Non-traditional, Non-blocking I/O
db.query(“select x from table_Y”,function (result){
doSomethingWith(result); //wait for result!
});
doSomethingWithOutResult(); //executes without any delay!
Natural & Features of Node.js ( some confusing )
• Apply it in the coolest, sexiest, most popular
language on the planet.
• Node.js uses an event-driven, non-blocking I/O
model, which makes it lightweight.
• The big support of V8 from Google is a great power.
Why JavaScript was suitable for that ?
• JavaScript Callbacks feature that solve the problem of
event-loops.
• The great NPM (Node Package Manager).
• Node.js JavaScript quite different : there is no DOM
implementation provided by Node.js,
• i.e. you can not do this:
var element = document.getElementById(“elementId”);
• Everything inside Node.js runs in a single-thread.
Natural & Features of Node.js ( some confusing )
What can we do with Node.js
• You can create an HTTP server and print ‘hello world’
on the browser in just 4 lines of JavaScript.
• You can create a DNS server.
• You can create a Web Chat Application like GTalk in the
browser.
• Node.js can also be used for creating online games,
collaboration tools or anything which sends updates to
the user in Real-time.
Example: Creating Http server
When to use Node.js ?
• streaming based Real-time services, online
games, web chat applications,..etc.
• If you need high level concurrency and not
worried about CPU-cycles.
• If you are good at JavaScript code.
• You will develop the front-end and back-end in the same
language, what a triumph 
Some Benchmarks (proof of power)
Taken from:
http://code.google.com/p/node-js-vs-apache-
php-benchmark/wiki/Tests
A benchmark between Apache+PHP
and node.js, shows the response time
for 1000 concurrent connections
making 10,000 requests each, for 5
tests.
Some Benchmarks (proof of power)
Taken from:
http://nodejs.org/jsconf2010.pdf
The benchmark shows the
response time in milli-secs for 4
evented servers.
Who is using Node.js
Complete list can be found at: https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node
Some Modules you will love them
• Express– to make things simpler e.g. syntax, DB connections.
• Jade – HTML template system
• Socket.IO– to create real-time apps
• CoffeeScript – for easier JavaScript development
Find out more about some widely used Node.js modules at:
http://blog.nodejitsu.com/top-node-module-creators
The last thing to say (How to start ?!)
• Try to explore the rest of Node.js your self.
• I recommend a free book to start called
• ( O’raily Book : Up and Running With Node.js)
• Tutorial sites:
• Nodejs.org
• Letsnode.com
• Google.com
• The series of articles in arabic isA on ( medhatdawoud.net)
Medhat Dawoud
www.medhatdawoud.net
Twitter: @Med7atdawoud
Thanks

More Related Content

What's hot

How we use Bitbucket to build Bitbucket
How we use Bitbucket to build BitbucketHow we use Bitbucket to build Bitbucket
How we use Bitbucket to build BitbucketShunsuke (Sean) Osawa
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development WorkflowVũ Nguyễn
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana MandziukFwdays
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in GolangMo'ath Qasim
 
Difference between gitlab vs github vs bitbucket
Difference between gitlab vs github vs bitbucketDifference between gitlab vs github vs bitbucket
Difference between gitlab vs github vs bitbucketAcodez IT Solutions
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...Andrea Dottor
 
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010sullis
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingAugusto Lazaro
 
The New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by PythonThe New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by PythonAll Things Open
 
Using the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to BitbucketUsing the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to BitbucketLiam Dempsey
 
Webkit Chromium Contribution Process
Webkit Chromium Contribution ProcessWebkit Chromium Contribution Process
Webkit Chromium Contribution ProcessGyuyoung Kim
 
How Git and Gerrit make you more productive
How Git and Gerrit make you more productiveHow Git and Gerrit make you more productive
How Git and Gerrit make you more productiveKarsten Dambekalns
 
Intro to meteor @py gotham Aug 15-16 2015
Intro to meteor @py gotham Aug 15-16 2015Intro to meteor @py gotham Aug 15-16 2015
Intro to meteor @py gotham Aug 15-16 2015christieewen
 

What's hot (20)

How we use Bitbucket to build Bitbucket
How we use Bitbucket to build BitbucketHow we use Bitbucket to build Bitbucket
How we use Bitbucket to build Bitbucket
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
 
Microservices in Golang
Microservices in GolangMicroservices in Golang
Microservices in Golang
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
Difference between gitlab vs github vs bitbucket
Difference between gitlab vs github vs bitbucketDifference between gitlab vs github vs bitbucket
Difference between gitlab vs github vs bitbucket
 
Github PowerPoint Final
Github PowerPoint FinalGithub PowerPoint Final
Github PowerPoint Final
 
Nodejs
NodejsNodejs
Nodejs
 
Blazor, lo sapevi che...
Blazor, lo sapevi che...Blazor, lo sapevi che...
Blazor, lo sapevi che...
 
Firebase Code Lab - 2015 GDG Buffalo DevFest
Firebase Code Lab - 2015 GDG Buffalo DevFestFirebase Code Lab - 2015 GDG Buffalo DevFest
Firebase Code Lab - 2015 GDG Buffalo DevFest
 
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
 
The New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by PythonThe New York Times: Sustainable Systems, Powered by Python
The New York Times: Sustainable Systems, Powered by Python
 
Node js
Node jsNode js
Node js
 
Using the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to BitbucketUsing the GitHub App to Connect to Bitbucket
Using the GitHub App to Connect to Bitbucket
 
React Faceoff at Philly.NET
React Faceoff at Philly.NETReact Faceoff at Philly.NET
React Faceoff at Philly.NET
 
Webkit Chromium Contribution Process
Webkit Chromium Contribution ProcessWebkit Chromium Contribution Process
Webkit Chromium Contribution Process
 
Git
GitGit
Git
 
How Git and Gerrit make you more productive
How Git and Gerrit make you more productiveHow Git and Gerrit make you more productive
How Git and Gerrit make you more productive
 
Intro to meteor @py gotham Aug 15-16 2015
Intro to meteor @py gotham Aug 15-16 2015Intro to meteor @py gotham Aug 15-16 2015
Intro to meteor @py gotham Aug 15-16 2015
 

Viewers also liked

Viewers also liked (9)

Thread
ThreadThread
Thread
 
Threading
ThreadingThreading
Threading
 
Multi threading design pattern
Multi threading design patternMulti threading design pattern
Multi threading design pattern
 
multi threading
multi threadingmulti threading
multi threading
 
Threads c sharp
Threads c sharpThreads c sharp
Threads c sharp
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-Threading
 
Threading in C#
Threading in C#Threading in C#
Threading in C#
 
Threads c sharp
Threads c sharpThreads c sharp
Threads c sharp
 
Threading in c#
Threading in c#Threading in c#
Threading in c#
 

Similar to Real time web

Similar to Real time web (20)

Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node.js for beginner
Node.js for beginnerNode.js for beginner
Node.js for beginner
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Proposal
ProposalProposal
Proposal
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
What is Node.js
What is Node.jsWhat is Node.js
What is Node.js
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
 
Nodejs
NodejsNodejs
Nodejs
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Node
NodeNode
Node
 
Node js internal
Node js internalNode js internal
Node js internal
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
 
Node
NodeNode
Node
 

More from Medhat Dawoud

Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucketMedhat Dawoud
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxMedhat Dawoud
 
Intro to t sql – 3rd session
Intro to t sql – 3rd sessionIntro to t sql – 3rd session
Intro to t sql – 3rd sessionMedhat Dawoud
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st sessionMedhat Dawoud
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionMedhat Dawoud
 
Mesh cloud (road to mongoDB)
Mesh cloud (road to mongoDB)Mesh cloud (road to mongoDB)
Mesh cloud (road to mongoDB)Medhat Dawoud
 

More from Medhat Dawoud (12)

Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucket
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Select your career
Select your careerSelect your career
Select your career
 
Intro to t sql – 3rd session
Intro to t sql – 3rd sessionIntro to t sql – 3rd session
Intro to t sql – 3rd session
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd sessionIntro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
 
Mesh cloud (road to mongoDB)
Mesh cloud (road to mongoDB)Mesh cloud (road to mongoDB)
Mesh cloud (road to mongoDB)
 
Before start
Before startBefore start
Before start
 
DevMix Startup
DevMix StartupDevMix Startup
DevMix Startup
 
How to python
How to pythonHow to python
How to python
 
Program threats
Program threatsProgram threats
Program threats
 
Unusual C# - OOP
Unusual C# - OOPUnusual C# - OOP
Unusual C# - OOP
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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 web

  • 2.
  • 3. What is Real-time web • The meaning is that: users can see the contents as fast as the author publish it (like chat applications) • A lot of technologies are used to implement the Real-time systems. • Today I’m interested in a technology that do that for us in an easy, reliable, and fantastic way
  • 4. To create Real-time system on web we need .. • Very fast web server. • Very very fast I/O operations (Non-blocking). • System that depend on event-driven(event-loops). • Flexible tool to handle all of this in a simple way.
  • 5. Some technologies for Real-time systems Python [ twisted ] Ruby [ EventMachine ] Perl [ AnyEvent ] If you deal with one of them, this presentation will be really understood at once.
  • 6. Finally , The Magic Technology Appears • 2009 - this guy “Ryan Dahl” releases something that support the highly-performance concurrent applications. • It’s called Node.js
  • 7. What is Node.js ? • In simple words Node.js is ‘server-side JavaScript’. • In not-so-simple words Node.js is a high-performance network applications framework, well optimized for high concurrent environments. • It’s Open Source. It runs well on Linux systems, can also run on Windows systems. • uses an asynchronous event-driven model.
  • 8. What is Node.js ? • Built and run on V8 JavaScript engine. • In ‘Node.js’ , ‘.js’ doesn’t mean that its solely written JavaScript. It is 40% JS and 60% C++. • is now the most followed project on Github, exceeding Ruby on Rails .. woooooo • From the official site: ‘Node's goal is to provide an easy way to build scalable network programs’ - (from nodejs.org!)
  • 9. Google V8 engine • V8 is an open source JavaScript engine developed by Google. It’s written in C++ and is used in Google Chrome Browser. • Faster than SpiderMonkey (used in firefox) over 4 times ( when V8 was invented )  - from an expert on stakoverflow -
  • 10.
  • 11. Theory 1 : Event-loops Event-loops are the core of event-driven programming, almost all the UI programs use event-loops to track the user event, for example: Clicks, Ajax Requests etc. Client Event loop (main thread) C++ Threadpool (worker threads) Clients send HTTP requests to Node.js server An Event-loop is woken up by OS, passes request and response objects to the thread-pool Long-running jobs run on worker threads Response is sent back to main thread via callback Event loop returns result to client
  • 12. Theory 2 : Non-blocking I/O • Traditional I/O var result = db.query(“select x from table_Y”); doSomethingWith(result); //wait for result! doSomethingWithOutResult(); //execution is blocked! • Non-traditional, Non-blocking I/O db.query(“select x from table_Y”,function (result){ doSomethingWith(result); //wait for result! }); doSomethingWithOutResult(); //executes without any delay!
  • 13. Natural & Features of Node.js ( some confusing ) • Apply it in the coolest, sexiest, most popular language on the planet. • Node.js uses an event-driven, non-blocking I/O model, which makes it lightweight. • The big support of V8 from Google is a great power.
  • 14. Why JavaScript was suitable for that ? • JavaScript Callbacks feature that solve the problem of event-loops. • The great NPM (Node Package Manager). • Node.js JavaScript quite different : there is no DOM implementation provided by Node.js, • i.e. you can not do this: var element = document.getElementById(“elementId”); • Everything inside Node.js runs in a single-thread. Natural & Features of Node.js ( some confusing )
  • 15. What can we do with Node.js • You can create an HTTP server and print ‘hello world’ on the browser in just 4 lines of JavaScript. • You can create a DNS server. • You can create a Web Chat Application like GTalk in the browser. • Node.js can also be used for creating online games, collaboration tools or anything which sends updates to the user in Real-time.
  • 17. When to use Node.js ? • streaming based Real-time services, online games, web chat applications,..etc. • If you need high level concurrency and not worried about CPU-cycles. • If you are good at JavaScript code. • You will develop the front-end and back-end in the same language, what a triumph 
  • 18. Some Benchmarks (proof of power) Taken from: http://code.google.com/p/node-js-vs-apache- php-benchmark/wiki/Tests A benchmark between Apache+PHP and node.js, shows the response time for 1000 concurrent connections making 10,000 requests each, for 5 tests.
  • 19. Some Benchmarks (proof of power) Taken from: http://nodejs.org/jsconf2010.pdf The benchmark shows the response time in milli-secs for 4 evented servers.
  • 20. Who is using Node.js Complete list can be found at: https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node
  • 21. Some Modules you will love them • Express– to make things simpler e.g. syntax, DB connections. • Jade – HTML template system • Socket.IO– to create real-time apps • CoffeeScript – for easier JavaScript development Find out more about some widely used Node.js modules at: http://blog.nodejitsu.com/top-node-module-creators
  • 22. The last thing to say (How to start ?!) • Try to explore the rest of Node.js your self. • I recommend a free book to start called • ( O’raily Book : Up and Running With Node.js) • Tutorial sites: • Nodejs.org • Letsnode.com • Google.com • The series of articles in arabic isA on ( medhatdawoud.net)