SlideShare a Scribd company logo
Metarhia
Metarhia
Community and Technology Stack
for Distributed Highload Applications
and Data Storage
Timur Shemsedinov
@tshemsedinov
Alexey Orlenko
@aqrln
● Open Lectures (>1000 stud/year), 75 lect/semester
● Meetups
○ meetup.com/KievNodeJS (1349) 19 since 2014
○ meetup.com/NodeUA (1679) 13
○ meetup.com/HowProgrammingWorks (1206) 54
● Channels
○ t.me/metarhia (640)
○ t.me/HowProgrammingWorks (865)
● Groups
○ t.me/nodeua (358)
○ t.me/MetarhiaHPW (352)
Metarhia KievJS 22-Feb-2018
● Conceptual code
○ It’s short and impressive parts, I’ll show you
○ conceptual code becomes libs and examples
● Examples
○ github.com/HowProgrammingWorks
○ github.com/HowProgrammingWorks/Dictionary
○ contributors: 36, repos: 87, >500 examples
● Open Source
○ Technology stack: github.com/metarhia
● Contribution
○ Node.js and other projects contribution
Metarhia KievJS 22-Feb-2018
Metarhia KievJS 22-Feb-2018
Metarhia KievJS 22-Feb-2018
● Impress Application Server
for highload clusters and private clouds with Node.js
● JSTP protocol: RPC, event bus, db sync on TCP, TLS,
WebSocket and JSON5; with SDK for mobile and
desktop: JavaScript, Java, Swift, C++, Haskell, Python,
Objective-C, PHP, Golang, C#
● GlobalStorage: distributed reactive in-memory DBMS,
work in progress
● Metasync: asynchronous programming abstractions
● Maojian: testing framework
● Impress Application Server
https://github.com/metarhia/impress
● JSTP protocol
https://github.com/metarhia/jstp
● GlobalStorage
https://github.com/metarhia/globalstorage
● Metasync
https://github.com/metarhia/metasync
● Maojian
https://github.com/metarhia/maojian
Metarhia KievJS 22-Feb-2018
const projection = (meta, obj) => (
Object.keys(meta).reduce((hash, key) => (
hash[key] = meta[key].reduce(
(val, fn, i) => (i === 0 ? obj[fn] : fn(val)), null
), hash
), {})
);
const persons = [
{ name: 'Marcus Aurelius', city: 'Rome', born: 121 },
{ name: 'Victor Glushkov', city: 'Rostov on Don', born: 1923 },
{ name: 'Ibn Arabi', city: 'Murcia', born: 1165 },
{ name: 'Mao Zedong', city: 'Shaoshan', born: 1893 },
{ name: 'Rene Descartes', city: 'La Haye en Touraine', born: 1596 }
];
const md = {
name: ['name'],
place: ['city', upper, s => '<' + s + '>'],
age: ['born', age]
};
const p1 = curry(projection)(md);
const data = persons.map(p1);
console.dir(data);
const projection = (meta) => {
const keys = Object.keys(meta);
return obj => {
const hash = {};
let name, key, def, val, fn;
for (key of keys) {
def = meta[key];
[name, fn] = def;
val = obj[name];
if (fn) val = fn(val);
hash[key] = val;
}
return hash;
};
};
Metarhia KievJS 22-Feb-2018
Metarhia KievJS 22-Feb-2018
// EventEmitter
const emitter = (events = {}) => ({
on: (name, fn) => (events[name] = events[name] || []).push(fn),
emit: (name, ...data) => (events[name] || []).forEach(fn => fn(...data))
});
const emitter = (l, o) => (l = {}, o = {
on: (n, f) => (l[n] = l[n] || []).push(f),
emit: (n, ...d) => (l[n] || []).map(f => f(...d)),
once: (n, f, g) => o.on(n, g = (...a) => (f(...a), o.remove(n, g))),
remove: (n, f, e) => (e = l[n] || [], e.splice(e.indexOf(f), 1)),
clear: (n) => (n ? delete l[n] : l = {}),
count: (n) => (l[n] || []).length,
listeners: (n) => (l[n] || []).slice(),
names: () => Object.keys(l)
});
Metarhia KievJS 22-Feb-2018
Problems of Software Engineering
● Not scientific decision-making
● Voluntarism, no answers
● Fundamental knowledge is not popular
● Quality is not a goal for business
● No sense in work, coded for trash
Functor + Chaining + composition
const c1 = chain()
.do(readConfig, 'myConfig')
.do(doQuery, 'select * from cities')
.do(httpGet, 'http://kpi.ua')
.do(readFile, 'README.md');
c1();
function chain(prev = null) {
const cur = () => {
if (cur.prev) {
cur.prev.next = cur;
cur.prev();
} else {
cur.forward();
}
};
cur.prev = prev;
cur.fn = null;
cur.args = null;
cur.do = (fn, ...args) => {
cur.fn = fn;
cur.args = args;
return chain(cur);
};
cur.forward = () => {
if (cur.fn) {
cur.fn(cur.args, () => {
if (cur.next) {
cur.next.forward();
}
});
}
};
return cur;
}
Asynchronous composition
const fx = metasync(
[f1, f2, f3, [[f4, f5, [f6, f7], f8]], f9]
);
Concurrent Queue
const cq = metasync.queue(3)
.wait(2000)
.timeout(5000)
.throttle(100, 1000)
.process((item, cb) => cb(err, result))
.success((item) => {})
.failure((item) => {})
.done(() => {})
.drain(() => {});
Collector
const dc1 = metasync
.collect(3)
.timeout(5000)
.done((err, data) => {});
dc1(item);
const dc2 = metasync
.collect(['key1', 'key2', 'key3'])
.timeout(5000)
.done((err, data) => {});
dc2(key, value);
● Websocket Chat
https://github.com/HowProgrammingWorks/WebsocketChat
● LiveTable (interactive, multiuser)
https://github.com/HowProgrammingWorks/LiveTable
● Abstraction Layers
https://github.com/HowProgrammingWorks/AbstractionLayers
● IoC and DI
https://github.com/HowProgrammingWorks/InversionOfControl
https://github.com/HowProgrammingWorks/DependencyInjection
● Transactions
https://github.com/HowProgrammingWorks/Transaction
Metarhia Technology Stack Key Ideas
● Unification: API, data, contracts
● Homogeneity of server infrastructure
● No back compatibility
● Open Source & no vendor lock
● Architectural decisions
● Community and trainings
Node.js
● 3 Node.js contributors
@tshemsedinov, @aqrln, @belochub
● 1 Node.js core collaborator
@aqrln
● Notable contributions:
keepAliveTimeout for HTTP, substantially faster Unix
domain sockets, faster base64 decoding, pushing
N-API adoption forward, community work
Node.js
● https://habrahabr.ru/post/264851/
● https://aqrln.github.io/kyivjs-2017
Metarhia KievJS 22-Feb-2018
N-API (Node.js API) for Rust
M E M bI
Timur Shemsedinov
tshemsedinov@github
timur.shemsedinov@gmail.com
tshemsedinov@facebook
marcusaurelius@habrahabr
Alexey Orlenko
aqrln@github
aqrln@twitter
eaglexrlnk@gmail.com
Metarhia

More Related Content

PDF
Asynchronous programming with java script and node.js
PDF
Asynchronous programming and mutlithreading
PDF
How are Race Conditions in single threaded JavaScript possible?
PDF
Node.js middleware: Never again!
PDF
Node.js in 2020 - part 3
PDF
Patterns and antipatterns
PDF
Node.js in 2020 - part 1
PDF
Node.js in 2020
Asynchronous programming with java script and node.js
Asynchronous programming and mutlithreading
How are Race Conditions in single threaded JavaScript possible?
Node.js middleware: Never again!
Node.js in 2020 - part 3
Patterns and antipatterns
Node.js in 2020 - part 1
Node.js in 2020

What's hot (20)

PDF
Web Locks API
PDF
JavaScript в браузере: Web API (часть 1)
PDF
Race-conditions-web-locks-and-shared-memory
PDF
Programming Languages: comparison, history, future
PDF
Новое в JavaScript: ES.Next, ECMAScript 2020, ES11, ES10, ES9, ES8, ES7, ES6,...
PDF
Private cloud without vendor lock // Serverless
PDF
How to keep control and safety in the clouds
PDF
Node.js in 2020 - part 2
PDF
Prototype programming in JavaScript
PDF
Serverless Clouds (FaaS) and request context isolation in Node.js
PDF
Введение в SQL
PDF
JS Fest 2019 Node.js Antipatterns
PDF
JavaScript - Agora nervoso
PDF
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
PDF
Bytes in the Machine: Inside the CPython interpreter
PDF
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
PDF
Python opcodes
PDF
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
PDF
Diving into byte code optimization in python
PDF
All I know about rsc.io/c2go
Web Locks API
JavaScript в браузере: Web API (часть 1)
Race-conditions-web-locks-and-shared-memory
Programming Languages: comparison, history, future
Новое в JavaScript: ES.Next, ECMAScript 2020, ES11, ES10, ES9, ES8, ES7, ES6,...
Private cloud without vendor lock // Serverless
How to keep control and safety in the clouds
Node.js in 2020 - part 2
Prototype programming in JavaScript
Serverless Clouds (FaaS) and request context isolation in Node.js
Введение в SQL
JS Fest 2019 Node.js Antipatterns
JavaScript - Agora nervoso
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Bytes in the Machine: Inside the CPython interpreter
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
Python opcodes
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Diving into byte code optimization in python
All I know about rsc.io/c2go
Ad

Similar to Metarhia KievJS 22-Feb-2018 (20)

PDF
Refactoring to Macros with Clojure
PDF
PDF
talk at Virginia Bioinformatics Institute, December 5, 2013
PPTX
Groovy
ODP
Scala 2 + 2 > 4
PDF
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
PDF
Functional programming using underscorejs
PDF
GECon2017_Cpp a monster that no one likes but that will outlast them all _Ya...
PDF
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
PDF
I want help in the following C++ programming task. Please do coding .pdf
ODP
To Infinity & Beyond: Protocols & sequences in Node - Part 2
ODP
Clojure basics
PPTX
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
PDF
What can be done with Java, but should better be done with Erlang (@pavlobaron)
PDF
Python postgre sql a wonderful wedding
PPTX
Summary of C++17 features
PPSX
What's New In C# 7
PPTX
Introduction to kotlin + spring boot demo
PPSX
Scala @ TomTom
PDF
When RegEx is not enough
Refactoring to Macros with Clojure
talk at Virginia Bioinformatics Institute, December 5, 2013
Groovy
Scala 2 + 2 > 4
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
Functional programming using underscorejs
GECon2017_Cpp a monster that no one likes but that will outlast them all _Ya...
GECon 2017: C++ - a Monster that no one likes but that will outlast them all
I want help in the following C++ programming task. Please do coding .pdf
To Infinity & Beyond: Protocols & sequences in Node - Part 2
Clojure basics
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
What can be done with Java, but should better be done with Erlang (@pavlobaron)
Python postgre sql a wonderful wedding
Summary of C++17 features
What's New In C# 7
Introduction to kotlin + spring boot demo
Scala @ TomTom
When RegEx is not enough
Ad

More from Timur Shemsedinov (15)

PDF
How to use Chat GPT in JavaScript optimizations for Node.js
PDF
IT Revolution in 2023-2024: AI, GPT, business transformation, future professi...
PDF
Multithreading in Node.js and JavaScript
PDF
Node.js threads for I/O-bound tasks
PDF
Node.js Меньше сложности, больше надежности Holy.js 2021
PDF
Rethinking low-code
PDF
Hat full of developers
PDF
FwDays 2021: Metarhia Technology Stack for Node.js
PDF
Node.js for enterprise - JS Conference
PDF
Node.js for enterprise 2021 - JavaScript Fwdays 3
PDF
Node.js in 2021
PDF
Information system structure and architecture
PDF
Базы данных в 2020
PDF
Почему хорошее ИТ-образование невостребовано рыночком
PDF
Node.js security
How to use Chat GPT in JavaScript optimizations for Node.js
IT Revolution in 2023-2024: AI, GPT, business transformation, future professi...
Multithreading in Node.js and JavaScript
Node.js threads for I/O-bound tasks
Node.js Меньше сложности, больше надежности Holy.js 2021
Rethinking low-code
Hat full of developers
FwDays 2021: Metarhia Technology Stack for Node.js
Node.js for enterprise - JS Conference
Node.js for enterprise 2021 - JavaScript Fwdays 3
Node.js in 2021
Information system structure and architecture
Базы данных в 2020
Почему хорошее ИТ-образование невостребовано рыночком
Node.js security

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
history of c programming in notes for students .pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administration Chapter 2
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
AI in Product Development-omnex systems
PPTX
ai tools demonstartion for schools and inter college
PDF
medical staffing services at VALiNTRY
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Online Work Permit System for Fast Permit Processing
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
ManageIQ - Sprint 268 Review - Slide Deck
Upgrade and Innovation Strategies for SAP ERP Customers
PTS Company Brochure 2025 (1).pdf.......
Operating system designcfffgfgggggggvggggggggg
history of c programming in notes for students .pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Nekopoi APK 2025 free lastest update
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administration Chapter 2
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
AI in Product Development-omnex systems
ai tools demonstartion for schools and inter college
medical staffing services at VALiNTRY
2025 Textile ERP Trends: SAP, Odoo & Oracle

Metarhia KievJS 22-Feb-2018

  • 2. Metarhia Community and Technology Stack for Distributed Highload Applications and Data Storage
  • 4. ● Open Lectures (>1000 stud/year), 75 lect/semester ● Meetups ○ meetup.com/KievNodeJS (1349) 19 since 2014 ○ meetup.com/NodeUA (1679) 13 ○ meetup.com/HowProgrammingWorks (1206) 54 ● Channels ○ t.me/metarhia (640) ○ t.me/HowProgrammingWorks (865) ● Groups ○ t.me/nodeua (358) ○ t.me/MetarhiaHPW (352)
  • 6. ● Conceptual code ○ It’s short and impressive parts, I’ll show you ○ conceptual code becomes libs and examples ● Examples ○ github.com/HowProgrammingWorks ○ github.com/HowProgrammingWorks/Dictionary ○ contributors: 36, repos: 87, >500 examples ● Open Source ○ Technology stack: github.com/metarhia ● Contribution ○ Node.js and other projects contribution
  • 10. ● Impress Application Server for highload clusters and private clouds with Node.js ● JSTP protocol: RPC, event bus, db sync on TCP, TLS, WebSocket and JSON5; with SDK for mobile and desktop: JavaScript, Java, Swift, C++, Haskell, Python, Objective-C, PHP, Golang, C# ● GlobalStorage: distributed reactive in-memory DBMS, work in progress ● Metasync: asynchronous programming abstractions ● Maojian: testing framework
  • 11. ● Impress Application Server https://github.com/metarhia/impress ● JSTP protocol https://github.com/metarhia/jstp ● GlobalStorage https://github.com/metarhia/globalstorage ● Metasync https://github.com/metarhia/metasync ● Maojian https://github.com/metarhia/maojian
  • 13. const projection = (meta, obj) => ( Object.keys(meta).reduce((hash, key) => ( hash[key] = meta[key].reduce( (val, fn, i) => (i === 0 ? obj[fn] : fn(val)), null ), hash ), {}) ); const persons = [ { name: 'Marcus Aurelius', city: 'Rome', born: 121 }, { name: 'Victor Glushkov', city: 'Rostov on Don', born: 1923 }, { name: 'Ibn Arabi', city: 'Murcia', born: 1165 }, { name: 'Mao Zedong', city: 'Shaoshan', born: 1893 }, { name: 'Rene Descartes', city: 'La Haye en Touraine', born: 1596 } ]; const md = { name: ['name'], place: ['city', upper, s => '<' + s + '>'], age: ['born', age] }; const p1 = curry(projection)(md); const data = persons.map(p1); console.dir(data); const projection = (meta) => { const keys = Object.keys(meta); return obj => { const hash = {}; let name, key, def, val, fn; for (key of keys) { def = meta[key]; [name, fn] = def; val = obj[name]; if (fn) val = fn(val); hash[key] = val; } return hash; }; };
  • 16. // EventEmitter const emitter = (events = {}) => ({ on: (name, fn) => (events[name] = events[name] || []).push(fn), emit: (name, ...data) => (events[name] || []).forEach(fn => fn(...data)) }); const emitter = (l, o) => (l = {}, o = { on: (n, f) => (l[n] = l[n] || []).push(f), emit: (n, ...d) => (l[n] || []).map(f => f(...d)), once: (n, f, g) => o.on(n, g = (...a) => (f(...a), o.remove(n, g))), remove: (n, f, e) => (e = l[n] || [], e.splice(e.indexOf(f), 1)), clear: (n) => (n ? delete l[n] : l = {}), count: (n) => (l[n] || []).length, listeners: (n) => (l[n] || []).slice(), names: () => Object.keys(l) });
  • 18. Problems of Software Engineering ● Not scientific decision-making ● Voluntarism, no answers ● Fundamental knowledge is not popular ● Quality is not a goal for business ● No sense in work, coded for trash
  • 19. Functor + Chaining + composition const c1 = chain() .do(readConfig, 'myConfig') .do(doQuery, 'select * from cities') .do(httpGet, 'http://kpi.ua') .do(readFile, 'README.md'); c1(); function chain(prev = null) { const cur = () => { if (cur.prev) { cur.prev.next = cur; cur.prev(); } else { cur.forward(); } }; cur.prev = prev; cur.fn = null; cur.args = null; cur.do = (fn, ...args) => { cur.fn = fn; cur.args = args; return chain(cur); }; cur.forward = () => { if (cur.fn) { cur.fn(cur.args, () => { if (cur.next) { cur.next.forward(); } }); } }; return cur; }
  • 20. Asynchronous composition const fx = metasync( [f1, f2, f3, [[f4, f5, [f6, f7], f8]], f9] );
  • 21. Concurrent Queue const cq = metasync.queue(3) .wait(2000) .timeout(5000) .throttle(100, 1000) .process((item, cb) => cb(err, result)) .success((item) => {}) .failure((item) => {}) .done(() => {}) .drain(() => {});
  • 22. Collector const dc1 = metasync .collect(3) .timeout(5000) .done((err, data) => {}); dc1(item); const dc2 = metasync .collect(['key1', 'key2', 'key3']) .timeout(5000) .done((err, data) => {}); dc2(key, value);
  • 23. ● Websocket Chat https://github.com/HowProgrammingWorks/WebsocketChat ● LiveTable (interactive, multiuser) https://github.com/HowProgrammingWorks/LiveTable ● Abstraction Layers https://github.com/HowProgrammingWorks/AbstractionLayers ● IoC and DI https://github.com/HowProgrammingWorks/InversionOfControl https://github.com/HowProgrammingWorks/DependencyInjection ● Transactions https://github.com/HowProgrammingWorks/Transaction
  • 24. Metarhia Technology Stack Key Ideas ● Unification: API, data, contracts ● Homogeneity of server infrastructure ● No back compatibility ● Open Source & no vendor lock ● Architectural decisions ● Community and trainings
  • 25. Node.js ● 3 Node.js contributors @tshemsedinov, @aqrln, @belochub ● 1 Node.js core collaborator @aqrln ● Notable contributions: keepAliveTimeout for HTTP, substantially faster Unix domain sockets, faster base64 decoding, pushing N-API adoption forward, community work
  • 29. M E M bI