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!
version: "3" | |
services: | |
mongo1: | |
hostname: mongo1 | |
container_name: localmongo1 | |
image: mongo:4.0-xenial | |
expose: | |
- 27017 | |
ports: | |
- 27011:27017 |
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!
For those JavaScript programmers, event loop is an important concept, inevitably.
Literally, event loop is what JavaScritp uses to implement non-blocking execution. Understanding how the event loops works internally would benefit you a lot when programming in JavaScript.
There are two major environments JavaScript runs in: browser and Node.js.
https://stackoverflow.com/questions/56312692/what-is-the-difference-between-child-process-and-worker-threads | |
const fs = require('fs'); | |
(function mainline() { | |
process.nextTick(() => { | |
console.log('A'); | |
}); | |
console.log('B'); | |
setTimeout(() => { | |
console.log('C'); |
Types of Hashing | |
There are many different types of hash algorithms such as RipeMD, Tiger, xxhash and more, but the most common type of hashing used for file integrity checks are MD5, SHA-2 and CRC32. | |
MD5 - An MD5 hash function encodes a string of information and encodes it into a 128-bit fingerprint. MD5 is often used as a checksum to verify data integrity. However, due to its age, MD5 is also known to suffer from extensive hash collision vulnerabilities, but it’s still one of the most widely used algorithms in the world. | |
SHA-2 – SHA-2, developed by the National Security Agency (NSA), is a cryptographic hash function. SHA-2 includes significant changes from its predecessor, SHA-1. The SHA-2 family consists of six hash functions with digests (hash values) that are 224, 256, 384 or 512 bits: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256. | |
CRC32 – A cyclic redundancy check (CRC) is an error-detecting code often used for detection of accidental changes to data. Encoding the same data string using |
Replication - Copying an entire table or database onto multiple servers. Used for improving speed of access to reference records such as master data. | |
Partitioning - Splitting up a large monolithic database into multiple smaller databases based on data cohesion. Example - splitting a large ERP database into modular databases like accounts database, sales database, materials database etc. | |
Clustering - Using multiple application servers to access the same database. Used for computation intensive, parallelized, analytical applications that work on non volatile data. | |
Sharding - Splitting up a large table of data horizontally i.e. row-wise. A table containing 100s of millions of rows may be split into multiple tables containing 1 million rows each. Each of the tables resulting from the split will be placed into a separate database/server. Sharding is done to spread load and improve access speed. Facebook/twitter tables fit into this category. |
In mathematics, "sparse" and "dense" often refer to the number of zero vs. non-zero elements in an array (e.g. vector or matrix). | |
---> A sparse array is one that contains mostly zeros and few non-zero entries. | |
---> A dense array contains mostly non-zeros. | |
here's no hard threshold for what counts as sparse; it's a loose term, but can be made more specific. | |
For example, a vector is k-sparse if it contains at most k non-zero entries. Another way of saying this is that the vector's ℓ0 norm is k. | |
(https://en.wikipedia.org/wiki/Norm_(mathematics)) |
docker run --rm -i --user="$(id -u):$(id -g)" --net=none -v /"$PWD":/data blang/latex xelatex main.tex |