This will guide you through setting up a replica set in a docker environment using.
- Docker Compose
- MongoDB Replica Sets
- Mongoose
- Mongoose Transactions
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
<?php | |
$mongodb = new Mongo("mongodb://username:password@localhost/database_name"); | |
$database = $mongodb->database_name; | |
$collection = $database->collection; | |
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1; | |
$limit = 12; | |
$skip = ($page - 1) * $limit; | |
$next = ($page + 1); | |
$prev = ($page - 1); |
var crypto = require('crypto') | |
, rrange = 4294967296; | |
/** | |
* Return an integer, pseudo-random number in the range [0, 2^32). | |
*/ | |
var nextInt = function() { | |
return crypto.randomBytes(4).readUInt32BE(0); | |
}; |
<?PHP | |
/* | |
Simple implementation of process queue in PHP using MySQL database. | |
This method does not use simple semaphores, as it is impotant for the application to run input in sequential order for each thread (order of data received). | |
CREATE TABLE IF NOT EXISTS `sessions` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`thread` int(11) NOT NULL, | |
`time_initiated` decimal(14,4) unsigned NOT NULL, | |
`time_heartbeat` decimal(14,4) unsigned NOT NULL, |
This will guide you through setting up a replica set in a docker environment using.
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
PGBouncer is a lightweight connection pooler for PostgreSQL. CockroachDB is a cloud-native SQL database for building global, scalable cloud services that survive disasters.
CockroachDB is PostgreSQL wire compatible database, which means it aims to have tight compatibility with the PG ecosystem. Today, we're going to wire PGBouncer to work with CockroachDB. This article is meant to scratch the surface of possibilities unblocked by PGBouncer with CockroachDB and not meant to be an in-depth overview. We're currently researching this topic and will follow up with official docs on proper architecture and sizing of PGBouncer and CockroachDB.
var GEOLOCATION_ALLOW = true; | |
(() => { | |
try { | |
//geolocate: enable - true, disable - false | |
//get this setting from db | |
const geolocate = localStorage.getItem('geolocate'); | |
if (geolocate !== null) { | |
GEOLOCATION_ALLOW = Boolean(geolocate); | |
} |