Array Reduce Method In Javascript

Array reduce is one of the Array.prototype functions, that was added to javascript from ECMAScript 5. All browsers support this method.

This method executes a reducer function on each element of the array, resulting in single output value.

Read more...

MongoDB Replication

To avoid data loss that may occure due to hardware failure or some service interruptions, you need to ensure your availability of database. to increase availability you can run the same instance of a database on different locations.

Replication is the process of synchronizing data across multiple servers. Replication provides redundancy and increases data availability with multiple copies of data on different database servers. Replication protects a database from the loss of a single server. Replication also allows you to recover from hardware failure and service interruptions. With additional copies of the data, you can dedicate one to disaster recovery, reporting, or backup.

In some cases, replication can provide increased read capacity as clients can send read operations to different servers.

Read more...

Use NGINX To Build A Reverse Proxy

a proxy server is a mediator server that will forward every request from clients to different destinations. destination server does not see clients directly, so they don't know anything about those clients.

after accepting a request from a client, the proxy server will assign a port to that request and forwards the request to its destination. after receiving the reply on that port, the response will be forwarded to the client through the previous connection.

Read more...