as a JSON store
PostgreSQL MongoDB
| Table | Collection |
| Row | Document |
| Column | Field |
| Secondary Index | Secondary Index |
| Joins | Embedded documents, linking, $lookup & $graphLookup |
| GROUP_BY | Aggregation Pipeline |
MongoDB PostgreSQL
| Rich Data Model | Yes | No |
| Dynamic Schema | Yes | No |
| Data Validation | Yes | Yes for relational data, but none for JSON |
| Typed Data | Yes | Yes |
| Data Locality | Yes | No |
| Field Updates | Yes | Yes for relational data, but limited for JSON |
| Easy for Programmers | Yes | No |
PostgreSQL having a document store capability is nice but, in no way, does it replace MongoDB
https://www.mongodb.com/compare/mongodb-postgresql
https://github.com/Matt-Esch/virtual-dom
Heavily inspired by React.js
virtual-dom is a collection of modules designed to provide a declarative way of representing the DOM for your app. So instead of updating the DOM when your application state changes, you simply create a virtual tree or VTree, which looks like the DOM state that you want. virtual-dom will then figure out how to make the DOM look like this efficiently without recreating all of the DOM nodes.
var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');
// 1: Create a function that declares what the DOM should look like
function render(count) {
return h('div', {
style: {
textAlign: 'center',
lineHeight: (100 + count) + 'px',
border: '1px solid red',
width: (100 + count) + 'px',
height: (100 + count) + 'px'
}
}, [String(count)]);
}
// 2: Initialise the document
var count = 0; // We need some app data. Here we just store a count.
var tree = render(count); // We need an initial tree
var rootNode = createElement(tree); // Create an initial root DOM node ...
document.body.appendChild(rootNode); // ... and it should be in the document
// 3: Wire up the update logic
setInterval(function () {
count++;
var newTree = render(count);
var patches = diff(tree, newTree);
rootNode = patch(rootNode, patches);
tree = newTree;
}, 1000);