Building a meshwork
 of nodeJS servers

to run a live-synced
 one-page WebApp
Who‘s talking to you here?



                            Toni Wagner


                     PhD in molecular biology


     Learned Basic when computers were still breadboxes

I built solutions for my lab and ended up doing it out of my box
https://meinunterricht.de




                            https://mylinkcloud.com
Create a
Desktop-Experience
     Web App
fast...   short initial load time
          no latency for user interactions
          no internal page loads
          live-sync
reliabile...   no data loss
               safe passwords
               safe accounting data
               live-failover
modular...   code modules largely independent
             modules distrubutable across servers
             client plug & play per account type
extendable...   (open) API for client modules
                (open) API for other clients
                readable code
There is nothing like that, so
 let‘s build it from scratch!!!
VisualWeb
jQuery-Ui                   mongoDB

         CLIENT          socket.io         SERVERS

                                     connect         nodeJS
jQuery
                  doT
                                          hook.io
Models
          Search                 &
                     Web     Controllers

Logging              (api)

           CLIENTS                         Payment



                        Mesh
  API
                        Hook
            Files                          DB
between clients and servers

                 between clients and clients

         How to run communication ????????????

                       between client code modules

between server code modules

                           between servers and servers
https://github.com/itsatony/bubPubSub
<div id=„A“>
                       <div id=„B“>
                              <div id=„C“>
                              </div>
                       </div>
                </div>



jQuery(„#A“).bind(„click“, f(e) { alert(„yo“);});


          jQuery(„#C“).trigger(„click“);
branch                  topic


/universe/milkyway/sol/earth/europe/germany/börlin/
/universe/milkyway/sol/earth/europe/germany/
/universe/milkyway/sol/earth/europe/
/universe/milkyway/sol/earth/
/universe/milkyway/sol/
/universe/milkyway/
/universe
/
bubPubSub.subscribe(
         „/client/desktop/show/ “,
         function(pubData) {
                announce(„Now showing desktop „ + pubData.desktop.name);
         },
         options,
         subscriber
  );
                             bubPubSub.publish(
                                    „/client/desktop/show/12345678“,
                                    someData,
                                    options,
                                    publisher
                             );
bubPubSub.subscribe(
       „/client “,
       function(pubData) {
              log(„showing desktop „ + pubData.desktop.name);
       },
       options,
       subscriber
);
bubPubSub.subscribe(
         „/server “,
         function(pubData, pubTopic) {
                socket.send(pubTopic, pubData);
         },
         options,
         subscriber
  );
                             bubPubSub.publish(
                                    „/server/desktop/get/12345678“,
                                    someData,
                                    options,
                                    publisher
                             );
bubPubSub.subscribe(
       „/client “,
       function(pubData, pubTopic) {
               socket.send(pubTopic, pubData);
       },
       options,
       subscriber
);
between clients on different servers


              but SYNC      ??????


        between clients on the same server
bubPubSub

            on top of

HOOOOOOOOOOOOOOOOOOOOOOOK.io
Hook.io propagates events across connected instances
via an event (=== simple pubSub) system.

Hook.io employs socket.io to establish connections
between the connected instances.
All server types are spawnable Ubuntu 12.04 VMs

We connect all servers to the meshwork via IPv6

We have a meshingNeeded Filter sitting at bubPubSub root

We have a hook/bubPubSub adapter to determine receivers
Our ChannelSystem allows event-specific sync
as each Socket has specific channels for

         Socket-specific messages

         Desktop-specific messages

         Item-specific messages

         User-specific messages

         UserGroup-specific messages
DISCUSS PLEASE!
Building a Framework
         on a
Javascript-Only Stack
Create a
Desktop-Experience
     Web App
fast...   short initial load time
          no latency for user interactions
          no internal page loads
          live-sync
reliabile...   no data loss
               safe passwords
               safe accounting data
               live-failover
modular...   code modules largely independent
             modules distrubutable across servers
             client plug & play per account type
extendable...   (open) API for client modules
                (open) API for other clients
                readable code
There is nothing like that, so
 let‘s build it from scratch!!!
VisualWeb
Alright, but
    WhyTheF...
all in JavaScript?
It‘s a lot easier to learn....

   It‘s a lot easier to teach....

       It‘s a lot easier to maintain....

          It‘s a lot easier to extend....
It‘s a lot easier to keep code quality....

   It‘s a lot easier to re-use code....

       It‘s a lot easier to document well....
Chrome and V8 are not going away....

   HTML5 & JS are here to stay.....

       HTML5 is the only winner in the OS fragmentation war....
Javascript has the fastest evolving interpreters...

          Javascript is untyped, just like the web...

            Javascript is JSON...



Javascript is the only language i know anything about !!!
Why the hell should we render anything serverside?


Losing state? What‘s that good for?
Dynamic is not enough!
Super-Hyper-Dynamically interactive is what we want!!



Responsive layouts are a very tiny prison cell.
jQuery-Ui                   mongoDB

         CLIENT          socket.io         SERVERS

                                     connect         nodeJS
jQuery
                  doT
                                          hook.io
We will constantly publish open-source modules.


          Up to now, we released...


               • bubPubSub
               • aList
               • aEscalator
Soon, we will release

A fork of jQueryUI that deals with scaling for drag and drop

A fork of oAuth2 server-sided services following the standards
Later, we will release

The public parts of our API to allow third-party development.

Yoda, our websocket and hook.io focused load balancer.

A description for our new publishing format.
Well, that‘s it for talking into the dark
..

So, why don‘t you Ask and Criticise
so we can discuss a bit?
Reach me via


                                                   i@itsatony.com

http://coffeelog.itsatony.com


                            @itsatony on twitter

                                                    https://github.com/itsatony

       http://about.itsatony.com

                                            I AM ON GEEKLIST

VisualWeb - Building a NodeJS Server Meshwork and Full-Javascript Stack Framework.

  • 1.
    Building a meshwork of nodeJS servers to run a live-synced one-page WebApp
  • 2.
    Who‘s talking toyou here? Toni Wagner PhD in molecular biology Learned Basic when computers were still breadboxes I built solutions for my lab and ended up doing it out of my box
  • 3.
    https://meinunterricht.de https://mylinkcloud.com
  • 4.
  • 5.
    fast... short initial load time no latency for user interactions no internal page loads live-sync
  • 6.
    reliabile... no data loss safe passwords safe accounting data live-failover
  • 7.
    modular... code modules largely independent modules distrubutable across servers client plug & play per account type
  • 8.
    extendable... (open) API for client modules (open) API for other clients readable code
  • 9.
    There is nothinglike that, so let‘s build it from scratch!!!
  • 10.
  • 11.
    jQuery-Ui mongoDB CLIENT socket.io SERVERS connect nodeJS jQuery doT hook.io
  • 12.
    Models Search & Web Controllers Logging (api) CLIENTS Payment Mesh API Hook Files DB
  • 13.
    between clients andservers between clients and clients How to run communication ???????????? between client code modules between server code modules between servers and servers
  • 14.
  • 15.
    <div id=„A“> <div id=„B“> <div id=„C“> </div> </div> </div> jQuery(„#A“).bind(„click“, f(e) { alert(„yo“);}); jQuery(„#C“).trigger(„click“);
  • 16.
    branch topic /universe/milkyway/sol/earth/europe/germany/börlin/ /universe/milkyway/sol/earth/europe/germany/ /universe/milkyway/sol/earth/europe/ /universe/milkyway/sol/earth/ /universe/milkyway/sol/ /universe/milkyway/ /universe /
  • 17.
    bubPubSub.subscribe( „/client/desktop/show/ “, function(pubData) { announce(„Now showing desktop „ + pubData.desktop.name); }, options, subscriber ); bubPubSub.publish( „/client/desktop/show/12345678“, someData, options, publisher ); bubPubSub.subscribe( „/client “, function(pubData) { log(„showing desktop „ + pubData.desktop.name); }, options, subscriber );
  • 18.
    bubPubSub.subscribe( „/server “, function(pubData, pubTopic) { socket.send(pubTopic, pubData); }, options, subscriber ); bubPubSub.publish( „/server/desktop/get/12345678“, someData, options, publisher ); bubPubSub.subscribe( „/client “, function(pubData, pubTopic) { socket.send(pubTopic, pubData); }, options, subscriber );
  • 19.
    between clients ondifferent servers but SYNC ?????? between clients on the same server
  • 20.
    bubPubSub on top of HOOOOOOOOOOOOOOOOOOOOOOOK.io
  • 21.
    Hook.io propagates eventsacross connected instances via an event (=== simple pubSub) system. Hook.io employs socket.io to establish connections between the connected instances.
  • 22.
    All server typesare spawnable Ubuntu 12.04 VMs We connect all servers to the meshwork via IPv6 We have a meshingNeeded Filter sitting at bubPubSub root We have a hook/bubPubSub adapter to determine receivers
  • 23.
    Our ChannelSystem allowsevent-specific sync as each Socket has specific channels for Socket-specific messages Desktop-specific messages Item-specific messages User-specific messages UserGroup-specific messages
  • 24.
  • 25.
    Building a Framework on a Javascript-Only Stack
  • 26.
  • 27.
    fast... short initial load time no latency for user interactions no internal page loads live-sync
  • 28.
    reliabile... no data loss safe passwords safe accounting data live-failover
  • 29.
    modular... code modules largely independent modules distrubutable across servers client plug & play per account type
  • 30.
    extendable... (open) API for client modules (open) API for other clients readable code
  • 31.
    There is nothinglike that, so let‘s build it from scratch!!!
  • 32.
  • 33.
    Alright, but WhyTheF... all in JavaScript?
  • 34.
    It‘s a loteasier to learn.... It‘s a lot easier to teach.... It‘s a lot easier to maintain.... It‘s a lot easier to extend....
  • 35.
    It‘s a loteasier to keep code quality.... It‘s a lot easier to re-use code.... It‘s a lot easier to document well....
  • 36.
    Chrome and V8are not going away.... HTML5 & JS are here to stay..... HTML5 is the only winner in the OS fragmentation war....
  • 37.
    Javascript has thefastest evolving interpreters... Javascript is untyped, just like the web... Javascript is JSON... Javascript is the only language i know anything about !!!
  • 38.
    Why the hellshould we render anything serverside? Losing state? What‘s that good for?
  • 39.
    Dynamic is notenough! Super-Hyper-Dynamically interactive is what we want!! Responsive layouts are a very tiny prison cell.
  • 40.
    jQuery-Ui mongoDB CLIENT socket.io SERVERS connect nodeJS jQuery doT hook.io
  • 41.
    We will constantlypublish open-source modules. Up to now, we released... • bubPubSub • aList • aEscalator
  • 42.
    Soon, we willrelease A fork of jQueryUI that deals with scaling for drag and drop A fork of oAuth2 server-sided services following the standards
  • 43.
    Later, we willrelease The public parts of our API to allow third-party development. Yoda, our websocket and hook.io focused load balancer. A description for our new publishing format.
  • 44.
    Well, that‘s itfor talking into the dark .. So, why don‘t you Ask and Criticise so we can discuss a bit?
  • 45.
    Reach me via i@itsatony.com http://coffeelog.itsatony.com @itsatony on twitter https://github.com/itsatony http://about.itsatony.com I AM ON GEEKLIST