Posts

MongoDB

MongoDB is a document database which belongs to a family of databases called NoSQL - not only SQL. In MongoDB, records are documents which behave a lot like JSON objects in JavaScript. Values in documents can be looked up by their field’s key. Documents can have some fields/keys and not others, which makes Mongo extremely flexible. Features Relational (SQL) Non-Relational (NoSQL) Data Type Hard to store rich data type Able to store literally any type of data Scaling Not trivial to scale, and not cheap Scaling is automatic and transparent Cost Expensive to build and maintain Around 10% cost to Relational DB Representation Represents data in tables and rows Represents data as collections of JSON documents Query Structured Query Language (SQL): makes SQL injection attack possible Object Querying: intuitive, passing a document to explain what you're querying for Multi-originated JOIN operation: perform query across multiple tables Multi-dimensional data type: support...

www1, www2 so on?

Its a technique for load balancing when you have multiple web servers so you called them www1, www2, etc because you can't set up multiple web servers on the same domain name and name them all www because then there would be no way to tell which server to access. Once you get to the domain or sub-domain you can then have one or more computers hosting that domain or sub-domain. Each of these computers has a machine name and where there is only one the machine name of www is usually used. Where a machine name is left off of the front of the domain or sub-domain name the default machine name of www is usually assumed so that the person will still reach the right computer to access the site Source: Q

Var and Let

Difference between Var and Let  Take a Example :- var senti=10; if (senti == 10) { var senti =20; console.log("cond block var check",senti); } console.log("outside conditional",senti); Output :- cond block var check 20 outside conditional 20 var senti=10; if (senti == 10) { let senti =20; console.log("cond block var check",senti); } console.log("outside conditional",senti); Output :- cond block var check 20 outside  conditional 10

SessionStorage, localStorage and Cookies

SessionStorage, localStorage and Cookies:- sessionStorage, localStorage and Cookies all are used to store data on the client side. Each one has its own storage and expiration limit.   LocalStorage : stores data with no expiration date, and gets cleared only through JavaScript, or       clearing the Browser Cache / Locally Stored Data   SessionStorage : similar to localStorage but expires when the browser closed (not the tab).   Cookie : stores data that has to be sent back to the server with subsequent requests. Its expiration varies based on the type and the expiration duration can be set from either server-side or client-side (normally from server-side). Cookies are primarily for server-side reading (can also be read on client-side), localStorage and sessionStorage can only be read on client-side.