What is the difference between asynchronous and synchronous HTTP request?

Synchronous: A synchronous request blocks the client until operation completes. In such case, javascript engine of the browser is blocked. Asynchronous An asynchronous request doesn’t block the client i.e. browser is responsive. At that time, user can perform another operations also. In such case, javascript engine of the browser is not blocked.

Difference between web server, application server and database server

This often gets confusing. Firstly – “Server” can refer to a physical thing (a computer), or a logical thing (a piece of software). Web, application and database server software can all run on the same physical server machine, or be distributed across multiple physical machines. Most large websites have multiple machines; most “consumer” hosting packages … Read more

Tomcat is web server or application server? [closed]

Tomcat is a web server (can handle HTTP requests/responses) and web container (implements Java Servlet API, also called servletcontainer) in one. Some may call it an application server, but it is definitely not an fullfledged Java EE application server (it does not implement the whole Java EE API). See also: What exactly is Java EE? … Read more

apache not accepting incoming connections from outside of localhost

In case not solved yet. Your iptables say: state RELATED,ESTABLISHED Which means that it lets pass only connections already established… that’s established by you, not by remote machines. Then you can see exceptions to this in the next rules: state NEW tcp dpt:ssh Which counts only for ssh, so you should add a similar rule/line … Read more

Some fundamental but important questions about web development?

Update, Spring 2018: I wrote this response in 2010 and since then, a whole lot of things have changed in the world of a web backend developer. Namely, the advent of the “cloud” turning services such as one-click load balancers and autoscaling into commodities have made the actual mechanics of scaling your application much easier … Read more

Multithreaded web server in python

Check this post from Doug Hellmann’s blog. from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import ThreadingMixIn import threading class Handler(BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.end_headers() message = threading.currentThread().getName() self.wfile.write(message) self.wfile.write(‘\n’) return class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): “””Handle requests in a separate thread.””” if __name__ == ‘__main__’: server = ThreadedHTTPServer((‘localhost’, 8080), Handler) print ‘Starting server, use <Ctrl-C> to stop’ … Read more

What are the trade-offs between different methods of constructing API URLs: subdomain vs. subdirectory and versioning? [closed]

It depends on your needs. If you use http://api.example.com it makes your API a subdomain. Basically, this URL pattern is good if your REST service is to be consumed by multiple clients, but if only one client is connected to your API then the pattern http://example.com/api/v1 is good. However, if you want to add more … Read more