Skip to content

Instantly share code, notes, and snippets.

View ojengwa's full-sized avatar
🏠
Working from home

Bernard Ojengwa ojengwa

🏠
Working from home
View GitHub Profile

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

// 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);
@ojengwa
ojengwa / deploy_docs
Last active November 3, 2018 14:49
Ichnaea Deploy docs
## 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
@ojengwa
ojengwa / bookshelf-virtual plugin support for strapi models
Created January 29, 2019 14:03
This simple alteration to the strapi-hook-bookshelf package adds support for model virtuals
'use strict';
/**
* Module dependencies
*/
// Core
const path = require('path');
// Public node modules.
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
@ojengwa
ojengwa / gist:e51ead51ad12b68508d13b95d4ddb391
Created March 6, 2020 20:00 — forked from afair/gist:3803895
PostgreSQL and Pgpool Architecture

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!

PostgreSQL and Pgpool Architecture