design, development

Why ‘cd’ is not an external command like ls?

cd command changes the current directory to desired valid path. The shell is a process that runs user commands. Each command is run by forking a new process and exec’ing. After exec, the child process dies. cd changes the current environment. If cd is an external command, the usual flow of fork->exec would cause environment […]

Read more
design, go, golang, internals

Go Runtime Scheduler Design Internals

Concurrency is one of the most exciting features of Go language. A single threaded program runs serially, but if you have tasks that can run concurrently, you create threads for such tasks. Threads execute independently and progress concurrently. Go supports creation of thousands of threads in an application!! How is it possible? It’s Go’s runtime. […]

Read more
design, internals, networking

NAT Protocol Simplified Explanation

The purpose of NAT protocol is to reduce usage of public IPs A host needs a public IP to connect to Internet If the host is part of a LAN with a gateway router, a host can use private IP to make requests to public Internet. The public Internet would see that all the requests […]

Read more
async, design, development, programming

Design Internals of UNIX Non Blocking Sockets

Fundamental of asynchronous programming: Non Blocking Sockets Why async socket programming An application can create thousands of sockets but creating a thread per socket becomes infeasible for a large number (e.g. 100k sockets) An async framework consists non-blocking sockets and an event loop * The kernel allows applications to seek for an event * Application […]

Read more
design, development, web architecture

What is ETag?

A web client (a browser) requests a resource from a web server. Multiple calls for a resource would hit the server everytime and server sends the response with return code 200. What if the requested data is unchanged for most of the calls? Could the client somehow help server with the previous value of the […]

Read more