今天晚些时候我有一个面试,我可能会被问到的示例问题之一如下:
“描述对 http://mywebsite.com/jobs/edit/1 的请求从前端到中间/API 到后端的生命周期。每一步都需要什么样的软件架构?”
我对此不是很确定。有人可以帮助我并发布他们认为可以很好地回答此类问题的内容吗?谢谢。
最佳答案
我猜这个问题中的架构,软件是指。
1. The IP of mywebsite.com is resolved by a DNS request.
2. The DNS request is answered by the DNS server.
3. A TCP/IP connection is opened to *.*.*.*
A http get/post request is issued to the server via HTTP
4a) A firewall is passed (if present), and the request is hopefully forwarded to the web-server
4b) The web-server receives the request,
and based on it's virtual hosting configuration information and the information in the http-headers, will forward the request to the respective application
via FastCGI or using a Server-Module/ISAPI.'
5. The web-application receives the request for http://mywebsite.com/jobs/edit/1
6a) HTTP-modules are executed for this request (e.g. forms authentication, banning)
6b) If the route is registered in the routing regex, the request is routed to the appropriate MVC controller (jobs)
7. The edit action in the MVC controller is called with parameter 1
8. The edit view is returned for parameter 1
9. The client receives the HTML
10. the port is closed by the client & server
"Describe the lifecyle of a request to http://mywebsite.com/jobs/edit/1 from front-end to middle/API to backend.
What kind of software architecture would be needed at each step?"
1. Requires DNS-client
2. Requires DNS-Server
3. Requires web-browser or TCP/IP/HTTP capable application
4. Requires web-server that is virtual name based hosting capable
5. Requires a web-application, like PHP/ASP.NET/Python/Perl
6-8. Requires MVC application architecture
9-10. Stateless architecture
关于css - Web 请求生命周期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25137254/