Skip to content

Instantly share code, notes, and snippets.

@lifeisfoo
lifeisfoo / replicationwiki.md
Created March 4, 2023 10:03 — forked from judahschvimer/replicationwiki.md
Replication Internals Wiki

Replication in 3.4

Replication is the set of systems used to continuously copy data from a primary server to secondary servers so if the primary server fails a secondary server can take over soon. This process is intended to be mostly transparent to the user, with drivers taking care of routing queries to the requested replica. MongoDB supports two forms of replication: replica sets and master-slave.

Master-Slave

This article will focus on replica sets, which are the main way people use replication today. Master-slave has one master node and multiple slave nodes. Slaves replicate from the master and all failover is done manually. Slave nodes can only replicate from other slave nodes if the other slave nodes are configured as masters themselves.

Master-slave replication also allows for filtered replication. Slaves can replicate some chosen subset of the collections.

@lifeisfoo
lifeisfoo / s3cmd_sync_policy
Created January 22, 2018 11:40 — forked from ngstigator/s3cmd_sync_policy
IAM policy for s3cmd sync
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
#!/bin/bash
###############################################################################
## ##
## Build and package OpenSSL static libraries for OSX/iOS ##
## ##
## This script is in the public domain. ##
## Creator : Laurent Etiemble ##
## ##
###############################################################################
@lifeisfoo
lifeisfoo / 0_reuse_code.js
Created January 26, 2014 13:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lifeisfoo
lifeisfoo / results.txt
Last active December 16, 2015 22:29 — forked from anonymous/results.txt
Running hphp... [84 errors in core]
--------------------------------
File : applications/vanilla/controllers/class.discussionscontroller.php:479
Reason : UseUndeclaredVariable
Snippet : $ID
Line : $User = $UserModel->GetID($ID, DATASET_TYPE_ARRAY);
--------------------------------
File : applications/vanilla/modules/class.promotedcontentmodule.php:281