Skip to content

Instantly share code, notes, and snippets.

@jkasaudhan
jkasaudhan / open-source-db-countries.md
Created April 2, 2025 07:26
open source databases and countries behind them
Database Origin Country Details
ClickHouse Russia Developed by Yandex, open-sourced in 2016. Community-driven since.
Greenplum USA Originally open-source; closed in 2024 by VMware/Broadcom.
Apache Druid USA Built by Imply Data (Khosla Ventures-backed). Strong real-time analytics focus.
DuckDB Netherlands Lightweight engine with academic roots. Strong GitHub community.
StarRocks China / USA Developed by CelerData. Open-sourced under the Linux Foundation.
@jkasaudhan
jkasaudhan / gist:3bd12eea0930581e388e64e1dc36aaf9
Last active April 2, 2025 07:20
open source database comparision
Criteria ClickHouse Greenplum Apache Druid DuckDB StarRocks
Columnar Storage
Open Source ✅ (Apache 2.0) ❌ (Closed Source) ✅ (Linux Foundation Project)
On-Premise Hosting
Security & RBAC
Tool Integration (Airbyte, Metabase)
@jkasaudhan
jkasaudhan / object-from-entries-property
Last active May 26, 2019 13:48
Object.fromEntries() property
// Transforms array or any iterables of [key, value] pairs into object
const entries = [['name', 'JK'], ['age', '30']];
Object.fromEntries(entries);
// {name: "JK", age: "30"}
@jkasaudhan
jkasaudhan / promise-all-settled-feature
Created May 26, 2019 13:05
Promise.allSetteled() feature in js
// Filter out successfull i.e fulfilled or resolved promises
const promises = [ fetch('index.html'), fetch('https://does-not-exist/') ];
const results = await Promise.allSettled(promises);
const successfulPromises = results.filter(p => p.status === 'fulfilled');
// Filter out failed promises
const promises = [ fetch('index.html'), fetch('https://does-not-exist/') ];
const results = await Promise.allSettled(promises);
const errors = results.filter(p => p.status === 'rejected')
@jkasaudhan
jkasaudhan / intl-list-format-api
Created May 26, 2019 12:42
Internationalization ListFormat api
// English version
const formatter = new Intl.ListFormat('en');
formatter.format(['january', 'february', 'march'])
// january, february, and march
const formatterConj = new Intl.ListFormat('en', {type: 'conjunction'});
// january, february, and march => by defaut type is 'conjunction'
const formatterDisj = new Intl.ListFormat('en', {type: 'disjunction'});
@jkasaudhan
jkasaudhan / relative-time-format-object
Last active May 26, 2019 12:27
Browser's internationalization api RelativeTimeFormat
// For english version - it can be applied to second, minute,
// day, week, hour, month and quarter
const rtf = new Intl.RelativeTimeFormat('en');
rtf.format(2, 'day')
// in 2 days
rtf.format(-2, 'day')
// two days ago
// Without .flatMap()
var arr1 = [1, 2, 3, 4];
arr1.map(x => [x * 2]);
// [[2], [4], [6], [8]]
arr1.map(x => [x * 2]).flat();
// [2,4,6,8]
// With .flatMap() => it is faster than above method
@jkasaudhan
jkasaudhan / native-lazy-loading-support-img-iframes
Created May 26, 2019 10:17
Native lazy loading support for img and iframe html tags
<img src="teaser.jpg" loading="lazy" alt="…" /> 
<iframe src="youtube.html" loading="lazy"></iframe>
@jkasaudhan
jkasaudhan / private-class-field-in-js
Created May 26, 2019 10:15
Private class field in js
class Person {
  #salary = '12345'; // => private class field
getSalary() {
this.#salary;
}
}
class jack = new Person();
console.log(jack.#salary); // will prompt syntax error as it is private filed
@jkasaudhan
jkasaudhan / array-flat-method-example
Last active May 26, 2019 10:13
Array.flat() method in js
var arr1 = [[1,2], [3,4], [5, 6]];
arr1.flat();
// [1,2,3,4,5,6]
var arr2 = [1, 2, [3, 4]];
arr2.flat();
// [1, 2, 3, 4]
var arr3 = [1, 2, [3, 4, [5, 6]]];
arr3.flat();