How to build a scalable application / api?

Scalability is the ability of a system network or process to handle a growing amount of work in a capable manner or its ability to be enlarged to accomodate that growth.

  • Use cloud that has ability to launch server on demand
  • Use load balancer (Amazon ELB, Rackspace Load Balancer)
  • Choose the right data storage (SQL or noSQL)
  • cache things
  • queue up everything that doesn’t need to be done synchronously, stats, logs notifications
  • Automate everything – you should be able to launch servers that self configure and get added to the resource pool automatically
  • run load tests
  • monitor everything – setup alerts
  • separate business logic into Service Oriented Architecture

More read here

Youtube video about Amazon AWS Services here

HTTP Verbs

  • GET is to get representation of the resource
  • PUT is to create or update a resource
  • POST is it to create a resource
  • DELETE is to delete a resource
  • HEAD is very similar to GET and it is mainly used to check if the resource exist.
  • PATCH is used to modify a part of the resource
  • OPTIONS allows the client to determine the options and/or requirements associated with a resource

What does idempotency stand for in REST?

Idempotency guarantees clients that repeating the same request has the same effect as making a request just once.

DELETE method is idempotent. This implies that the server must return response code 200 OK even if the server deleted the resource in a previous request. For DELETE it means that the server should keep track of previous delete requests (or deleted resources).

Idempotent methods:

GET, HEAD, OPTIONS,PUT, DELETE

Non idempotent methods:

POST, PATCH