Impress Application Server for node.js (en)

1,379 views
1,197 views

Published on

Multipurpose Application Server for Node.JS. All decisions are made. Solutions are scaled. Tools are provided and optimized for high load. Ready for applied development and production.

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,379
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Impress Application Server for node.js (en)

  1. 1. Multipurpose Application Server for Node.JS All decisions are made. Solutions are scaled Tools are provided and optimized for high load Ready for applied development and production
  2. 2. Scaling Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 1 Multiple applications • at single server • at single node.js process • at single tcp/ip port • at one domain (different path) One application • multiple processes at single server • multiple processes at multiple servers • at multiple domains (virtualhosts) • at multiple network interfaces • at multiple ports • over multiple protocols
  3. 3. Scaling Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 2 Deployment strategies: • All in one process (for development): cluster.strategy: "single" • Separate process for each host/port pair: cluster.strategy: "specialization" • Single server cluster, master + multiple workers cluster: { strategy: "multiple", workers: N } • Single server cluster with IP-sticky cluster.strategy: "sticky" • Multiple servers with multiple workers on each: strategy: "specialization", + nginx provides balancing and sticky • Applied cloud: hardware balancer, multiple servers with multiple workers, strategy: "multiple", ØMQ, impress controller
  4. 4. Scaling Load Balancer Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins Impress Application Server HTTP С2 С1 С3 IPC C1N1 C1N2 C1N3 C2N1 C2N2 C2N3 C3N1 ØMQ pub/sub + req/rep 3 С0 Impress Cloud Controller C3N2
  5. 5. Filesystem Structure Installation: npm install impress After that we have: Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 4 Processing steps: • access.js • request.js • get.js, post.js... • html.template
  6. 6. URL Routing Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 5 Features: • folders are URL-handlers • handlers and templates inheritance/overriding • handlers by result type (html, json, csv, xml…) • serving handlers and templates from memory • filesystem monitoring and cache refreshing • files changes consolidation • multiple handler instances in memory • URL-rewriting (using regular expressions) • routing and reverse-proxy
  7. 7. Configuration Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 6 • file: config.js • file system monitoring • config.js soft reloading • configuration preprocessing
  8. 8. Configuration Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 7
  9. 9. Configuration Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 8
  10. 10. API Development Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 9
  11. 11. API Development Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 10 • RPC API (Stateful, state will store in RAM between request/response pairs) • REST API (Stateless, each request/responce is independent, order is not important, state is not stored in RAM) State classification: • system global state • session (or connection) state • user state • data-object (subject domain) state
  12. 12. API Development Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 11
  13. 13. Templating Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 12
  14. 14. Templating Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 13
  15. 15. Static Resources Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 14 • Serves static files directly from RAM (memory cache) • File system monitoring and cache refreshing when file changes • Cache garbage collection (multiple file buffers) removes items when deleting files or folders • Gzip compresion (except small files) storing gzipped files in RAM • Implemented HTTP if-modified-since and HTTP error 304 (Not modified) • Client JavaScript minification (using plugin "uglify-js")
  16. 16. Events (SSE) Client1 Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 15 Client2 Client3 С1 IPC C1N1 C1N2 C1N3 … ClientN
  17. 17. Events (SSE) Client1 Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins Client2 Client3 … ClientN HTTP/SSE С2 С1 С3 IPC C1N1 C1N2 C1N3 C2N1 C2N2 C2N3 C3N1 ØMQ pub/sub + req/rep 16 С0 Impress Cloud Controller C3N2
  18. 18. DB Access Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 17 • Database drivers are plugins /lib/db.*.js • Utilities for SQL-compatible DBMS • Database schema compilation from JSON • DBMI Web-interface for database management • MongoDB • MySQL
  19. 19. DB Access / DBMI Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 18
  20. 20. Plugins Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 19 • mail plugin (using nodemailer, multiparty) • geoip plugin (using geoip-lite, optional installation) • CMS plugin (in development) • authentication, authorisation and accounting plugin • npm plugin (optional installation)
  21. 21. Contacts and links Scaling Filesystem Structure URL Routing Configuration API Development Templating Static Resources Events (SSE) DB Access Plugins 20 https://npmjs.org/package/impress https://github.com/tshemsedinov/impress http://blog.aumcode.com http://bit.ly/1cSdTF3 (NFX, AUM, UNISTACK) mailto:timur.shemsedinov@gmail.com skype:timur.shemsedinov npm install impress

×