Living on the Edge(.js)! Survive and thrive with JavaScript and .NET in one process

Post on 05-Jul-2015

262 views 0 download

description

by Rafał Legiędź - If you're one of those developers who are tied to a .NET platform but are willing to use JavaScript whenever possible? Or maybe you develop server-side applications in JavaScript and you would like to call infrastructure code written in .NET? During this session you will get to know how to deal with above scenarios by using Edge.js module, which allows you to run Node.js and .NET code in one process on Windows, MacOS, and Linux.

Transcript of Living on the Edge(.js)! Survive and thrive with JavaScript and .NET in one process

MILAN november 28th/29th, 2014

Living on the EdgeSurvive and Thrive with JavaScript and .NET running in-process

rafal.legiedz@gmail.com@rafek

ABB

Rafał Legiędź

MILAN november 28th/29th, 2014 – Rafał Legiędź

About me

Rafał Legiędźrafal.legiedz@gmail.com

@rafek

MILAN november 28th/29th, 2014 – Rafał Legiędź

Node.jsPlatform built on Chrome’s V8 JavaScript engine that provides an event-driven architecture and a non-blocking I/O API that optimizes an apllication’s throughput and scalability.

MILAN november 28th/29th, 2014 – Rafał Legiędź

Node.js in practice

„[..] the only developer community that was built from day one around asynchronous, event-driven application logic as a core principle.”

~ Node.js is taking over the Enterprise

„On Black Friday the WalMart servers didn’t go over 1% CPU utilisation and the team did a deploy with 200,000,000 users online.”

~ Why Node.js is becoming the go-to technology in the enterprise

MILAN november 28th/29th, 2014 – Rafał Legiędź

Node.js use cases

MILAN november 28th/29th, 2014 – Rafał Legiędź

.NETAdvantages over Node.js:

MILAN november 28th/29th, 2014 – Rafał Legiędź

Edge.js„[..] provides an asynchronous, in-process mechanism for interoperability between Node.js and .NET”

…on Windows, Linux and Mac OS X

MILAN november 28th/29th, 2014 – Rafał Legiędź

Edge.js – interop model

MILAN november 28th/29th, 2014 – Rafał Legiędź

Edge.js – possibilitiesEnables or simplifies application scenarios which are hard or impossible to achieve with Node.js alone:•implementing CPU-bound workloads in-process•simplifying access to Windows specific functionality•extending Node.js in .NET instead of native C

in any CLR language using inline code, separate files or assemblies.

MILAN november 28th/29th, 2014 – Rafał Legiędź

What problem does it solve?

MILAN november 28th/29th, 2014 – Rafał Legiędź

Edge.js – code

MILAN november 28th/29th, 2014 – Rafał Legiędź

Installing Edge.js• >= Node.js 0.8.x• .NET Framework 4.5 or Mono 3.4.0

MILAN november 28th/29th, 2014 – Rafał Legiędź

.NET that scripts Node.js in-process

MILAN november 28th/29th, 2014 – Rafał Legiędź

Tips• External class/assembly over inline code• Separate modules• Stay async• Benchmark• Node.js Tools for Visual Studio (Windows only)

MILAN november 28th/29th, 2014 – Rafał Legiędź

Alternatives• Stick with Node.js if possible• Process invocation (Node.js’s process api)• WebService (local/remote)• *MQ

MILAN november 28th/29th, 2014 – Rafał Legiędź

Resources• Edge.js presentation• Source code• This presentation• The Birth & Death of JavaScript (Gary Bernhardt)• Node.js is taking over the Enterprise• Why Node.js is becoming the go-to technology in the enterprise