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
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...
#3: Post edited
- 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
- 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
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.