Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
1. PG-native master-slave achitecture | |
1. Configure bindings and nodes on Both DB servers | |
a. Select staging DB as the master (main) | |
b. Set the prod DB as the slave node (aux) | |
2. PG automatically propagates and syncs the data between the DBs | |
3. Add or change data on the staging DB | |
a. Compare both dataset | |
b. Update records across both databases to ensure consistency | |
PROS |
'use strict'; | |
/** | |
* Module dependencies | |
*/ | |
// Core | |
const path = require('path'); | |
// Public node modules. |
## Deployment Guide | |
Mozilla Ichnaea has two depeendencies: | |
1. Mysql Server | |
2. Redis Server | |
To install, follow the following steps | |
1. ### Build the required images | |
1. Pull the custom Mysql Database image from Docker Hub |
// const test_array = [{name: "Bernard", ranking: 100}, {name:"Messi", ranking: 1}, {name:"McCain", ranking: 17} ] | |
function sorted(list){ | |
return list.sort(function(a, b){ | |
return a.ranking - b.ranking; | |
}); | |
} | |
function average_ranking(list){ | |
var sum = list.reduce( function(prev_obj, this_obj) { return prev_obj + this_obj.ranking }, 0); |
Vertical decomposition. Creating cohesive services
One of the biggest misconceptions about services is that a service is an independent deployable unit, i.e., service equals process. With this view, we are defining services according to how components are physically deployed. In our example, since it’s clear that the backend admin runs in its own process/container, we consider it to be a service.
But this definition of a service is wrong. Rather you need to define your services in terms of business capabilities. The deployment aspect of the system doesn’t have to be correlated to how the system has been divided into logical services. For example, a single service might run in different components/processes, and a single component might contain parts of multiple services. Once you start thinking of services in terms of business capabilities rather than deployment units, a whole world of options open.
What are the Admin UI
# Deploy to AWS using docker-machine and docker-compose | |
## 1. Prepare your machine | |
Please follow this steps: | |
1.1 Install docker in your localhost. [Installation link](https://docs.docker.com/engine/installation/) | |
1.2 Install docker-machine in your localhost. [Installation link](https://docs.docker.com/compose/install/) | |
1.3 Install docker-compose in your localhost. [Installation link](https://docs.docker.com/machine/install-machine/) | |
1.4 Create an account in AWS (skip this step if you already have one). [AWS](https://aws.amazon.com/) |
.PHONY: all | |
assets: | |
gsutil -m rsync -R <public_dir>/ gs://<bucket_id>/<public_dir> | |
worker: | |
gcloud app deploy worker.yaml --stop-previous-version --verbosity=info --promote --project=<project_id> | |
web: |
- What do Etcd, Consul, and Zookeeper do? | |
- Service Registration: | |
- Host, port number, and sometimes authentication credentials, protocols, versions | |
numbers, and/or environment details. | |
- Service Discovery: | |
- Ability for client application to query the central registry to learn of service location. | |
- Consistent and durable general-purpose K/V store across distributed system. | |
- Some solutions support this better than others. | |
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state. | |
- Centralized locking can be based on this K/V store. |
let unassigned = realtime.unassigned.child(attrs.body.order_id) | |
let assigned = realtime.assigned.child(attrs.body.order_id) | |
unassigned.ref.once('value', (data) => { | |
data = data.val() | |
data['status'] = 'assigned' | |
assigned.set(data, (error) => { | |
if (!error) { | |
let champion_ref = realtime.champions.child(attrs.body.champion_id + '/assigned/' + attrs.body.order_id) | |
champion_ref.set(data, (error) => { |