CodeNight #5: Framework

June 10, 2016 4:27 pm Published by Leave your thoughts

[fusion_builder_container background_color=”” background_image=”” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ background_repeat=”no-repeat” background_position=”left top” video_url=”” video_aspect_ratio=”16:9″ video_webm=”” video_mp4=”” video_ogv=”” video_preview_image=”” overlay_color=”” overlay_opacity=”0.5″ video_mute=”yes” video_loop=”yes” fade=”no” border_size=”0px” border_color=”” border_style=”” padding_top=”20″ padding_bottom=”20″ padding_left=”” padding_right=”” hundred_percent=”no” equal_height_columns=”no” hide_on_mobile=”no” menu_anchor=”” class=”” id=””][fusion_builder_row][fusion_builder_column type=”1_1″ last=”yes” spacing=”yes” center_content=”no” hide_on_mobile=”yes” background_color=”” background_image=”” background_repeat=”no-repeat” background_position=”left top” hover_type=”none” link=”” border_position=”all” border_size=”0px” border_color=”” border_style=”solid” padding=”” margin_top=”” margin_bottom=”” animation_type=”0″ animation_direction=”down” animation_speed=”0.1″ animation_offset=”” class=”” id=””][fusion_images picture_size=”auto” hover_type=”none” autoplay=”yes” columns=”1″ column_spacing=”0″ scroll_items=”” show_nav=”yes” mouse_scroll=”yes” border=”yes” lightbox=”no” class=”” id=””][fusion_image link=”” linktarget=”_self” image=”” alt=””/][fusion_image link=”” linktarget=”_self” image=”” alt=””/][fusion_image link=”” linktarget=”_self” image=”” alt=””/][fusion_image link=”” linktarget=”_self” image=”” alt=””/][/fusion_images][/fusion_builder_column][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”][fusion_text]

IDG held their reoccurring experience sharing event, Code Night. This time on the theme “Framework” and speakers were introducing frameworks to develop full-stack-applications. The products in presentation ranged from platforms for independent developers, to solid enterprise solutions – offering smooth gluing between layers, optimal stack and stellar performance.  As one of the companies who had the honor of holding a workshop, Starcounter was providing a hands-on workshop with developers under the encouraging topic “Thick VS Thin Client”. Our Lead Developer, Marcin Warpechowski broke down the full-stack approach to SW development. The purpose of the workshop was to analyse and identify the pains of having a Single-Page Applications thick clients and to suggest a lightweight thin client solution.

Let’s go deep

Usually, with thick client approach, the user interface is streamed from server to client app through multiple tiers of REST interface and client, coupled with JSON – all under the resource-oriented architecture paradigm. Main problems that are triggered by this approach frustrate user all over the world and include page freezing, latency and delayed consistency. If we remember physical characteristics of fat clients such as heavy code interconnected by ‘glue’ layers, duplicate logic and therefore overall complexity increase with double-end validation it is easy to understand SPA’s limitations those introduce. They bound much desired but hardly reachable quick transactions between page updates, no data redundancy and state consistency on web-applications.

The solution

A solution for streaming user interface using a combination of WebSocket, JSON and JSON-Patch that allows to build SPA-s without any need to write arbitrary APIs, such as REST, GraphQL or Falcor. Stateful connection of Server Application with a view-model to ultra-thin client with zero logic is realized by means of immediate JSON-Patches over HTTP. This two-way binding is provided by a novel protocol “PuppetJS” allowing fully interactive web front-end. Synchronization of JSON-Patches between concurrent server and client operations is maintained without delays or server denials by applying a new algorithm, called “Operational Transformation” that safely transfers the functional state of both parties and keeps consistent view of client-server “conversation”.

During the session Marcin described benefits to productivity, performance, UX and integrity for thin client, using suggested solution, but also mentioned existing limitations, such as necessity to have connection always on. In the current realities it can be tolerated by having cold-standby server for data replication. The session was highly hands-on and participating developers were very interested in the PuppetJS structure. A question that came up during the evening was if there is PuppetJS implementation for both client and server side. Current solution is available as a part of Starcounter, but development isn’t laid back, therefore the separate Puppet C# package will be on NuGet very soon. Other questions were centered around the Starcounter architecture itself and the server specifications that are applicable for our solution. To answer that question, basically any server is able to support Starcounter architecture as long as it supports long-lived JSON documents, modified by JSON-Patch over HTTP and WebSocket. Furthermore data consistency solution was raising a lot of questions, such as data security or MVVM updates events. All data transactions are secured on disk in a LOG-file. As READ operation is called only on startup, the WRITE operation is the only one being issued during actual work, therefore Starcounter is able to sustain performance of millions operations per second. JSON-Patch in our template engine is highly responsive and can proactively react on a each key press or focus/unfocus event – it straightly goes to the server. In case you have server on premise, you can enjoy stellar productivity with out-of-the-box real-time data sharing with ultra-thin client architecture by Starcounter.


Tags: , , ,

Categorised in: ,

This post was written by Olga Kostina

Leave a Reply

Your email address will not be published. Required fields are marked *