34
What Is This NetKernel Thing Anyway? Darren Cruse August 5, 2010 (for the Lambda Lounge of St. Louis) Wednesday, August 11, 2010

What's this NetKernel Thing Anyway?

Embed Size (px)

DESCRIPTION

This is a slide presentation introducing NetKernel, a kind of "REST operating system" from 1060.org. The title reflects what I often heard by co-workers who'd never heard of NetKernel. The talk tries to place in context why NetKernel is the right tool for right now - or at least should be on the short list of tools to look at.

Citation preview

Page 1: What's this NetKernel Thing Anyway?

What Is This NetKernel Thing

Anyway?

Darren CruseAugust 5, 2010

(for the Lambda Lounge of St. Louis)Wednesday, August 11, 2010

Page 2: What's this NetKernel Thing Anyway?

Preface(one slide answers all)

Wednesday, August 11, 2010

Page 3: What's this NetKernel Thing Anyway?

What’s This NetKernel Thing?• A “REST Based Microkernel”

• Written in Java

• Originally developed at HP Labs over 10 years ago

• Started life as an XML framework ala Cocoon

• Generalized over 4 versions into a general purpose “Resource Oriented Computing” framework (though it maintains esp. strong XML support).

• The main guys split off from HP and formed their own company called 1060 Research Limited

• It’s sold under a dual source license - i.e. free for open source projects, paid for commercial projects.

Wednesday, August 11, 2010

Page 4: What's this NetKernel Thing Anyway?

(that was the short answer - now the longer one)

Wednesday, August 11, 2010

Page 5: What's this NetKernel Thing Anyway?

Chapter 1:Lots of Computers

(macro)

Wednesday, August 11, 2010

Page 6: What's this NetKernel Thing Anyway?

In the Beginning There Was One Computer

• Plus a 300 baud modem

• I had hair

• Things were simple then (BASIC built in the ROM!)

Wednesday, August 11, 2010

Page 7: What's this NetKernel Thing Anyway?

State Of The Art

• 0.89 MHz Processor

• 4K RAM

• 192 x 128 Screen Resolution

• Audio Cassette Storage

Wednesday, August 11, 2010

Page 8: What's this NetKernel Thing Anyway?

And That Computer Begat Other Computers

Wednesday, August 11, 2010

Page 9: What's this NetKernel Thing Anyway?

And They Begat Some More...

Wednesday, August 11, 2010

Page 10: What's this NetKernel Thing Anyway?

And so on...

Wednesday, August 11, 2010

Page 11: What's this NetKernel Thing Anyway?

And so on...

Wednesday, August 11, 2010

Page 12: What's this NetKernel Thing Anyway?

And The World Became Awash(in computers)

Wednesday, August 11, 2010

Page 13: What's this NetKernel Thing Anyway?

They Climbed Into Our Pockets

Wednesday, August 11, 2010

Page 14: What's this NetKernel Thing Anyway?

And A Lot Had Changed.(Since The Time That I Had Hair)

Wednesday, August 11, 2010

Page 15: What's this NetKernel Thing Anyway?

But Not So Much AboutThe Way We Program

Wednesday, August 11, 2010

Page 16: What's this NetKernel Thing Anyway?

Chapter 2:Lots of Computers

(micro)

Wednesday, August 11, 2010

Page 17: What's this NetKernel Thing Anyway?

Dude -What Happened To 4 GHz?http://www.drdobbs.com/architecture-and-design/184405990

Wednesday, August 11, 2010

Page 18: What's this NetKernel Thing Anyway?

Moore No More?(nope - but it’s a different world)

Wednesday, August 11, 2010

Page 19: What's this NetKernel Thing Anyway?

“The Multi-Core Problem”

(http://www.drdobbs.com/architecture-and-design/184405990)

What This Means For Software: The Next RevolutionThe revolution in mainstream software development from structured programming to object-oriented programming was the greatest such change in the past 20 years, and arguably in the past 30 years. There have been other changes, including the most recent (and genuinely interesting) naissance of web services, but nothing that most of us have seen during our careers has been as fundamental and as far-reaching a change in the way we write software as the object revolution.

Until now.

Starting today, the performance lunch isn’t free any more. [...] But if you want your application to benefit from the continued exponential throughput advances in new processors, it will need to be a well-written concurrent (usually multithreaded) application. And that’s easier said than done, because not all problems are inherently parallelizable and because concurrent programming is hard.

Edited from: “The Free Lunch is Over”, Herb Sutter

Wednesday, August 11, 2010

Page 20: What's this NetKernel Thing Anyway?

Postscript to Chapters 1 & 2(in case it’s not obvious)

What’s the connection between “lots of computers on the network” (chapter 1) and “lots of cores on a cpu die” (chapter 2)?

The answer: Stuff running in Parallel

Wednesday, August 11, 2010

Page 21: What's this NetKernel Thing Anyway?

Chapter 3a:The Web

Wednesday, August 11, 2010

Page 22: What's this NetKernel Thing Anyway?

Chapter 3a:The Web

(of Lies and Deceit)

Wednesday, August 11, 2010

Page 23: What's this NetKernel Thing Anyway?

Actual made up conversationbetween Product Managers, Circa 2003

Lie #1

“Oh yeah the guys are using this new thing Service Oriented Architecture.

They put their software on a whole bunch of servers. That means it’s guaranteed to scale and have good performance and be like super super reliable.

It’s really simple it uses this new thing called SOAP. That stands for simple something or other. All they have to do is connect up these “service” things how hard could that be.

And they said something called REST I don’t what that is but it sounds easy too I guess it’s so easy the developers get to rest.

It’s going to save us lots of time and money it really sounds great.”

Wednesday, August 11, 2010

Page 24: What's this NetKernel Thing Anyway?

Chapter 3b:The Web

(for real this time)

Wednesday, August 11, 2010

Page 25: What's this NetKernel Thing Anyway?

The Web is a Very Successful “Distributed System” (with some very nice qualities)

✓ Flexibility★ It's fairly easy to rearrange things at the server/network level, e.g.

move a document (or dynamic “service”) from one node to another.

✓ Heterogenous Technologies★ Different servers can easily use different technologies (e.g. different

languages).

✓ Scalability★ In general, services scale easily, if they're stateless and placed behind

multiple machine clusters with load balancers.

✓ Availability / Ease of Deployment★ As long as you have at least two servers running the service, you can

hot deploy services leaving the old service running for a time while you're starting the new service ("rolling restart").

Wednesday, August 11, 2010

Page 26: What's this NetKernel Thing Anyway?

RESTful HTTP Based Services(bring the web’s benefits between servers)

Browser

AppServer

AppServer

Service 1

Service 1

Service 1

Service 2

load

balancer

balancer

balancer

Wednesday, August 11, 2010

Page 27: What's this NetKernel Thing Anyway?

NetKernel Modules and “Micro-Services”(bring the web’s benefits inside servers, as well as between)

Browser

load

balancer

balancer

balancer

Wednesday, August 11, 2010

Page 28: What's this NetKernel Thing Anyway?

So what are these granular services doing “inside” my program?

(revisiting those nice web qualities)

✓ More Flexibility★ Now there’s more opportunities to easily change things (e.g. change your

persistance strategy for some resource), often with just a configuration change.

★ And more opportunities to rearrange things on the network, e.g. moving a module to a different server and talking to it with some remote protocol instead of NetKernel’s in memory protocol.

★ Partly this is possible because of NetKernel’s caching which replicates local representations of remote resources just like a browser would (the reason it’s called “REpresentational State Transfer”! :).

Wednesday, August 11, 2010

Page 29: What's this NetKernel Thing Anyway?

So what are these granular services doing “inside” my program?

(revisiting those nice web qualities)

✓ More Heterogenous Technologies★ Easily use and intermix many of the popular JVM languages within a single

application. Java, Javascript, Groovy, JRuby, Scala, Clojure (experimental), Beanshell, XSLT, XQuery, etc.

★ Add support for other languages if you’d like. Each language is supported by a module called a “language runtime” and you can write your own as an “adapter” for an existing tool. e.g. I added support for the Jakarta Velocity templating language and it wasn’t hard.

★ Language runtimes follow the same REST principles which the rest of the system does. e.g. In NetKernel, an XML file transformed to an HTML file via an XSLT is much the same as a Groovy source file transformed to a class file by the Groovy compiler runtime. Your groovy code will automatically be recompiled when you modify it just as your html will be updated when you modify the xml. This applies to any and all of NetKernel’s supported scripting languages.

★ As a consequence, under the new NetKernel Protocol you can even execute code on a remote NetKernel server that physically resides on your local server. This is not a feature “added on” to NetKernel so much as a natural consequence of it’s design.

Wednesday, August 11, 2010

Page 30: What's this NetKernel Thing Anyway?

So what are these granular services doing “inside” my program?

(revisiting those nice web qualities)

✓ More Scalability★ NetKernel’s internal multi-threaded scheduler is to internal requests, as a

load balancer is to a web or application server.

★ Resource “representations” are immutable.

★ Accessor methods should be coded to be thread safe i.e. stateless.

★ More cpu cores mean more throughput / more simultaneous requests processed.

★ For faster response times, developers incorporate asynchronous requests to run sub-requests in parallel.

★ Third party libraries that are not thread safe can be wrapped in a module marked as such - in which case NetKernel will single thread them.

★ Representations that are not immutable can be locked explicitly - but this is not typical usage of NetKernel (it’s more of an escape hatch for bad code :).

Wednesday, August 11, 2010

Page 31: What's this NetKernel Thing Anyway?

So what are these granular services doing “inside” my program?

(revisiting those nice web qualities)

✓ More Availability / Easier Deployment★ Modules can be hot deployed via the “Apposite” tool while a system is live and

running.

★ If problems are encountered the deployed module can be rolled back leaving just the original module.

★ Modules are versioned and clients to services can indicate the version(s) they desire.

★ This allows that multiple versions of the same module can be deployed simultaneously. e.g. A “stable version” and a “release candidate” version.

Wednesday, August 11, 2010

Page 32: What's this NetKernel Thing Anyway?

NETKERNEL CACHE (IN-MEMORY)

CORE “N”CORE 1

BUS

“CLOUD OF RESOURCES”

NETKERNEL CACHE (IN-MEMORY)

CORE “N”CORE 1

BUS

NETWORK

(and URIs are a sort of “machine independent” memory address)

The network really is the computer...

Wednesday, August 11, 2010

Page 33: What's this NetKernel Thing Anyway?

You sound like a used car salesman.(is this some kind of infomercial?)

“Just a note that I was skeptical of NetKernel until I tried it and got used to it a little bit.

It helped me see some things I hadn’t realized before which is how many lost opportunities I’d created in my “service oriented” system design because of how different I was doing things inside my code from the way things are done between the services.

To give a simple example, if I need to read a file in a program in java I typically write some code and use the File object to read the file. I don't use "file://" like we do from our browser. As a result, if I want to change where that information comes from, say read it from a blob in Oracle, or read it from an XML database, or maybe a better example: read it from another machine RESTFully using HTTP - each of those feel like a fairly serious change, but not when everything has a URI like in NetKernel.”

Darren Cruse, NetKernel Advocate (seriously)

and inventor of the “Ultra-Toe” Toe Nail Brightening System,the only toe nail brightening system with Toe-nail-isol!!

Wednesday, August 11, 2010