HugeGlobal.php

PHP API For Redundant Distributed Systems

Overview:

Huge.Global serves four primary tasks for Ubuntu cluster programmers

  1. Replicate Your Databases: Replicate database records across all servers so that the hub and satellite servers remain perfect replicates of each other. This allows for users to perform CRUD operation on any of the cluster’s machines
  2. Replicate Your Files: Copy file duplicates across multiple servers and drives to ensure a minimal level of replication and fault tolerance → This allows for uploads and lookup queries to any machine
  3. Automate Your Cluster Updates:Automatically update any application script files or other resource files based on last modified from a central update folder on the Hub machine
  4. Monitor Your Hardware: Orchestrate and monitor the entire server hardware stack: hard drives, RAM, CPU, Network, Disks, Web Servers


Initialization

$scriptDir = dirName(__FILE__); 
include $scriptDir . "/hugeGlobalConfig.php"
include $scriptDir . "/php/HugeGlobal.php";
$HugeGlobal = new HugeGlobal();
//You can now use any HugeGlobal.php function

$HugeGlobal->close();

HugeGlobal PHP Functions

HugeGlobal offers a number of utilies for managing clusters, servers, disks, files, databases, and performance metrics:

$HugeGlobal->RunCommand($command, $options)
Adds an Ubuntu command to be run as the sudo user during the next heartbeat
$HugeGlobal->GetCommandResult($commandIds)
After RunCommand is called, GetCommandResult checks the status of the command's execution and returns the output if completed. $commandIds can be an array of command id strings or a single command id string.
$HugeGlobal->CopyFileIn($fileLoc, $fileDetails, $options)
Adds a file to the HugeGlobal file repository from elsewhere on disk and keeps the original file.
$HugeGlobal->MoveFileIn($fileLoc, $fileDetails, $options)
Adds a file to the HugeGlobal file repository from elsewhere on disk and deletes the original file. This should be used if the developer wants to import some files and free up space by deleting the original file.
$HugeGlobal->ClearCache()
To optimize performance, HugeGlobal uses a Redis cache to decease data lookup times for common objects. Call ClearCache to clear the cache completely so that the next data retrieval will be guaranteed to come from the database directly.
$HugeGlobal->getHostDetails()
The host details(information about the server) is stored ina file called hostdetails and is cached in Redis for faster data retrieval.
$HugeGlobal->GetConfig()
GetConfig gets all the information about the host details(see getHostDetails) but also returns all of the other info about the server that is stored in the database.
$HugeGlobal->CheckConfig()
This method provides a simple war for the developer to check if the PostgreSQL and Redis PHP modules are properly installed and if the Database is configured. Always ensure hugeGlobalConfig.php is properly configured and that the database you reference exists with permissions granted for your user.
$HugeGlobal->SaveConfig()
$HugeGlobal->GetMostViewedFiles()
$HugeGlobal->GetRecentlyViewedFiles()
$HugeGlobal->AddFileHit()
$HugeGlobal->UpdateNewDisk()
$HugeGlobal->UpdateNewServer()
$HugeGlobal->GetServerById()
$HugeGlobal->GetServerList()
$HugeGlobal->GetServerStats()
$HugeGlobal->GetAllServerStats()
$HugeGlobal->GetDiskById()
$HugeGlobal->GetDiskList()
$HugeGlobal->GetDiskStats()
$HugeGlobal->GetAllDiskStats()

Run From Command Line Or Cron Job

HugeGlobal makes it easy to manage an entire fleet of servers from an online portal.

Monitor server performance and specs, run commands, alter database structures, elect a new king.

Amplify With Confidence

Huge.Global

Happy Clients

Join the growing list of developers using Huge.Global!

  • BigDrive.io securely and redundantly stores all of its users beloved files with ease using the Huge.Global framework.

    BigDrive.io

File Replication

Files should be stored in multiple disks(on separate servers, preferably) to prevent any data loss if hardware failure should occur.