Skip to main content

On Shiny

ยท 2 min read
John Coene

A post on how ambiorix compares to shiny, what are their differences or similarities.

Introductionโ€‹

There are two great paradigms to build we applications (as far as I know): single page, and multipage.

They are fairly self explanatory, the former consists of a single page, whilst the latter consists of multiple pages.

However minor this difference may seem they have great impact of how applications are built, and the logic used.

Single Pageโ€‹

A single page application consists of the one page. The user enters the address of your application in their web browser, e.g.: www.yourwebsite.com/ and hits ENTER; the browser then makes a GET request your server which returns the page. In a single page application, that one page, and only that one will be loaded in the client's browser.

Every subsequent communication is likely done via the WebSocket and the page is modified using JavaScript. There may be other paths served which will not return HTML content (only one page does that) but instead returned data used in the application.

This is how shiny works.

Multipageโ€‹

Multiple page applications handle multiple paths. User may browse the home page but also, for instance, /about, and others. This is probably how your personal or company website functions.

In R, this is what you do with plumber: you handle multiple endpoints.

Logicโ€‹

What's more relevant for the developer is that this leads to two drastically different ways to program applications, and solve problems.

Also, this has a tendency to create different frameworks, where some focus one single pages and others on multipage. In the R world, for single page application, there is Shiny, to the best of my knowledge, this is the only frameworks to focus on this.

For multipage applications there is RestRserve, as well as prairie. However, the former focuses on build APIs (returning JSON) and the former appears to no longer be maintained.