Global Variables – Superglobals

Several predefined variables in PHP are “superglobals”, which means that they are always accessible, regardless of scope – and you can access them from any function, class or file without having to do anything special.

The PHP superglobal variables are:

$GLOBALS
$_SERVER
$_REQUEST
$_POST
$_GET
$_FILES
$_ENV
$_COOKIE
$_SESSION

$GLOBALS: $GLOBALS is a PHP super global variable which is used to access global variables from anywhere in the PHP script (also from within functions or methods). PHP stores all global variables in an array called $GLOBALS[index].

$_SERVER: $_SERVER is a PHP super global variable which holds information about headers, paths, and script locations.
example: $_SERVER[‘PHP_SELF’], $_SERVER[‘SERVER_NAME’], $_SERVER[‘HTTP_HOST’], $_SERVER[‘HTTP_REFERER’], $_SERVER[‘HTTP_USER_AGENT’];

$_REQUEST: $_REQUEST, by default, contains the contents of $_GET, $_POST and $_COOKIE

$_POST: PHP $_POST is widely used to collect form data after submitting an HTML form with method=”post”.

$_GET: PHP $_GET can also be used to collect form data after submitting an HTML form with method=”get”.

$_FILES is a super global variable which can be used to upload files.

$_ENV is used to return the environment variables form the web server.
Example: $_ENV[“HOSTNAME”], $_ENV[“USER”], $_ENV[“COMPUTERNAME”]

Features of NoSql Databases

1) Elastic Scaling: Because of the distributed nature of non-relational databases, to scale NoSQL all you need to do is add machines to the cluster to meet demand. The new breed of NoSQL databases are designed to expand transparently to take advantage of new nodes, and they’re usually designed with low-cost commodity hardware in mind.

2) Big Data: They handle much bigger data volumes with relative ease.

3) Economics: NoSQL databases typically use clusters of cheap commodity servers to manage the exploding data and transaction volumes, while RDBMS tends to rely on expensive proprietary servers and storage systems.

4) Flexible Data Models: Even minor changes to the data model of an RDBMS have to be carefully managed and may necessitate downtime or reduced service levels. NoSQL databases have far more relaxed — or even nonexistent — data model restrictions. NoSQL Databases usually have “Eventual Consistency”.

5) Little Downtime: Because of their distributed nature, NoSQL databases can be pretty much always on. This is a huge advantage for web- and mobile-based businesses that can’t afford to be down for a single moment.

6) Auto-Sharding: NoSQL databases, on the other hand, usually support auto-sharding, meaning that they natively and automatically spread data across an arbitrary number of servers, without requiring the application to even be aware of the composition of the server pool. Data and query load are automatically balanced across servers, and when a server goes down, it can be quickly and transparently replaced with no application disruption.