Posts

DoItAll: part 00 Backend developer wanting to "build an app"

Image
I've never been an all rounder, I've always created backend services in my work but never stepped into the realms of the other parts of software development, devOps, front end, architecture, etc. I have an idea that I want to build, but frustratingly I feel overwhelmed by the gaps I have in my knowledge. I feel paralysed and not knowing where to start. But I am an engineer, this is just another set of problems to find solutions for. So I will be creating a series of posts chronicling my experience. Hopefully this will be the start of an enlightening and fun experience.

Comparing REST and GraphQL

Image
This article will compare REST with the lesser known  GraphQL  style APIs. What is a REST API? REST (Representational State Transfer) is a client-server architecture style centred around resources and the state transitions can go through. A resource is named and located via a URI (Uniform Resource Identifier) . Usually, the HTTP transport protocol is used which give access to the standard HTTP methods/verbs allowing CRUD (create, read, update, delete) operations to be performed on the resources. The accepted CRUD operation to HTTP verb mappings can be found here .   For instance: curl -X GET http://api.com/users/1/photos/1 -H 'Content-Type: application/json' In the above example, the HTTP verb GET is used to indicate a read operation, the Content-Type:  application/JSON header indicates the desired representation. There are many more REST architectural constraints which would make an API truly RESTful but this is the general minimal you'll...

Comparing Authentication and Authorization

Image
This is a large and somewhat confusing topic in software engineering. It doesn't help that we often abbreviate both terms to "auth", so first an explanation in plain English: Authentication : Are you who you say you are. Authorization : What you are allowed to do. It is useful to have the above one-liners in mind when thinking about these terms. Authentication is the act of confirming a claim to be true, authentic, real, genuine.  E.g. A person at airport claims to be Kye Yeung with a passport. The security guard authenticates this claim. Authorization is the act of giving permission to access resources. E.g. My nephew asks if he can play video games for an hour, I can authorize/give him permission to do so or not. This article will discuss a few popular internet security technologies but is by no means exhaustive. Basic HTTP Authentication Basic HTTP authentication , often abbreviated to "basic auth", is a protocol that requires client requests t...

Comparing VM's and Containers

Image
Both technologies are concerned with virtualization, both need a piece of software to run, both have images, both are concerned with operating systems. So what's the difference between the two? According to Wikipedia "virtualization" is "the act of creating a virtual (rather than actual) version of something" . Very vague indeed, let's explore further. VM A virtual machine ( VM ) is hardware virtualization, it is a virtual computer, complete with ram, hard disk, CPU resource allocation. A VM  can be just this virtual computer, however an operating system is usually installed making it usable. Once a VM has been created it can be exported into VM image. The VM obviously can have any other application installed as you can like any other computer. In an execution environment a  VM is a "guest machine", run via a hypervisor/virtual machine monitor (VMM) on a "host machine". There are types of hypervisors, bare-metal (type-1) and ho...

Comparing the execution model of Spring Boot, Akka and NodeJs

Image
There are many technologies to choose from for implementing a backend service and it's not immediately obvious which to choose. This article will compare the execution model of a few popular technologies, which is one of the key points to consider. Note I chose a rather vague term "technologies" as each technology describe themselves differently, framework, toolkit, runtime etc. "technologies" felt apt. To illustrate the differences I have implemented the same simple service in each of the technologies under consideration. These are Spring Boot 1.5.x  [1] , NodeJs  [2] , Spring Boot 2.x  [3] and Akka  [4] .The service contains a single '/books' endpoint that retrieves data from a Mongo DB. Spring Boot 1.5.x Spring Boot 1.5.x has one-thread-per-client-request execution module, synchronous and blocking. The following sequences of steps occur when the service  [1]  receives a client request `curl -X GET http://localhost:8080/boo...