Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

71%
+3 −0
Q&A Using an existing web server vs writing your own

When writing a dynamic web service, you broadly speaking have two paths: Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own cod...

4 answers  ·  posted 7mo ago by Iizuki‭  ·  last activity 7mo ago by Basile Starynkevitch‭

#3: Post edited by user avatar Iizuki‭ · 2023-10-21T05:23:50Z (7 months ago)
Grammar
  • When writing a dynamic web service, you broadly speaking have two paths:
  • 1. Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own code as a separate process that communicates with the server using a gateway protocol (e.g. FastCGI). A typical PHP service is a great example of this.
  • 2. Skip the general purpose web server altogether and write your program to handle the request directly. Typically you would use some web framework which takes care of most technicalities. Services written in Rust tend to take this path.
  • My question is that if you are using a language that is generally suitable for implementing a standalone web server (such as Rust), is there any advantage with the first path? General pros and cons of both architectures are also welcome.
  • When writing a dynamic web service, you broadly speaking have two paths:
  • 1. Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own code as a separate process that communicates with the server using a gateway protocol (e.g. FastCGI). A typical PHP service is a great example of this.
  • 2. Skip the general purpose web server altogether and write your program to handle the requests directly. Typically you would use some web framework which takes care of most technicalities. Services written in Rust tend to take this path.
  • My question is that if you are using a language that is generally suitable for implementing a standalone web server (such as Rust), is there any advantage with the first path? General pros and cons of both architectures are also welcome.
#2: Post edited by user avatar Iizuki‭ · 2023-10-20T11:56:14Z (7 months ago)
Grammar
  • When writing a dynamic web service, you broadly speaking have two paths:
  • 1. Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own code as a separate process that communicates with the server using a gateway protocol (e.g. FastCGI). A typical PHP service is a great example of this.
  • 2. Skip the general purpose web server altogether and write your program to handle the request directly. Typically you would use some web framework which takes care of most technicalities. Services written in Rust tend to take this path.
  • My question is that if you are using a language that is generally suitable for implementing a standalone web server (such as Rust), is there any advantage to go with the first path? General pros and cons of both architectures are also welcome.
  • When writing a dynamic web service, you broadly speaking have two paths:
  • 1. Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own code as a separate process that communicates with the server using a gateway protocol (e.g. FastCGI). A typical PHP service is a great example of this.
  • 2. Skip the general purpose web server altogether and write your program to handle the request directly. Typically you would use some web framework which takes care of most technicalities. Services written in Rust tend to take this path.
  • My question is that if you are using a language that is generally suitable for implementing a standalone web server (such as Rust), is there any advantage with the first path? General pros and cons of both architectures are also welcome.
#1: Initial revision by user avatar Iizuki‭ · 2023-10-20T11:55:09Z (7 months ago)
Using an existing web server vs writing your own
When writing a dynamic web service, you broadly speaking have two paths:

1. Use an existing web server (e.g. Apache, Nginx or Lighttpd) to handle the "raw" web requests and implement your own code as a separate process that communicates with the server using a gateway protocol (e.g. FastCGI). A typical PHP service is a great example of this.

2. Skip the general purpose web server altogether and write your program to handle the request directly. Typically you would use some web framework which takes care of most technicalities. Services written in Rust tend to take this path.

My question is that if you are using a language that is generally suitable for implementing a standalone web server (such as Rust), is there any advantage to go with the first path? General pros and cons of both architectures are also welcome.