Thoughts about the cutting-edge of server programming
https://news.ycombinator.com/item?id=10053405I am currently working on a project to develop a secure mobile app using micro-services written in Go, Node.js, and Lua targeted at both Android and iOS. I am writing the back-end which will be cloud-based. I thought it would be a good idea for me to share some of my experiences.
Micro-services are the coming absolute standard in server architecture. Dividing a program up into smaller pieces has always be one of the principles of computer science, but to take it one step further and to have different parts of the program in different machines use to be only in the realm of super-computing. Cheap cloud-computing allows everyone to easily create their own clusters, and micro-services are the best architecture.
Of course our queries are RESTful, but we chose to use a simplified form. The requests are URL-queries, and it seems that the lowest common denominator for how long they can be is 2k characters (to be accessible to all browsers). The responses, though, are always in JSON.
Go is an incredible language whose standard library has enough components to satisfy 90% of one's needs. One can think of it as an improved C, so it lacks inheritance, function overloading, and generics. I hope someone creates a fork called Go++. I did some tests, the Go HTTP component was 80% as fast as Nginx, but they were only simple page loads, since Nginx's scripting language is not that complete.
Node.js is the most powerful way to do server-side scripting. Tens of thousands of packages means that one hardly has to write any code. And the speed is pretty decent, but do not even try to do anything CPU intensive. Node.js is JavaScript which is compiled with the V8 Engine and single-threaded.
I also realized the differences between concurrency and parallelism. When there is only 1 CPU, it is not possible to have parallelism. Parallelism includes concurrency, but concurrency is not parallel.