Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Old guy...Looking for advise on web platform selection.

by RedJeep (Sexton)
on Feb 02, 2018 at 21:18 UTC ( #1208368=perlquestion: print w/replies, xml ) Need Help??

RedJeep has asked for the wisdom of the Perl Monks concerning the following question:

Hello. Ok, upfront, I have been out of the web app development world for a few years and I was never the best web developer. Mostly I did Perl related system admin and integration on Windows (minimal Linux). My web app experience is with Perl::CGI. Seems that Perl:CGI isn't the hot thing it was many years ago.

I'd like to stay with Perl 5 and am asking for feedback on what framework or modules would be both easiest for me to ramp on and be reasonable on performance. I have read through many of the posts but didn't come up with a readily identifiable solution for my needs… Dancer vs Dancer2? CGI::Lite? CGI::Simple? Should I just make the jump to React, Angular or Go?

The project: Parts (like an inventory system) lookup and ordering system. The web app will experience short periods of high volume usage. The app may have up to 1000 concurrent users with very short sessions. The sessions will be one of two types: 1) user registration to MySQL, and 2) web form for parts query read/update MySQL.

Perhaps a max of ten web pages. No pagination. Very simple web template or I can just code per page.

Business logic is very simple. Data structure and queries are also very simple. The database may end up with several millions of records though. We have a DBA to deal with the database side of things.

The system will need to detect the user's browser and redirect to the appropriate "desktop" or "mobile". The system will be publicly available.

Platform info:
Windows server 2016
Apache webserver (but could be MS IIS)

  • Comment on Old guy...Looking for advise on web platform selection.

Replies are listed 'Best First'.
Re: Old guy...Looking for advise on web platform selection.
by chromatic (Archbishop) on Feb 02, 2018 at 23:17 UTC

    Mojolicious is a good choice. I haven't used Dancer2, so if that style is more to your liking, either one would work.

    Deployment with a modern PSGI-style framework like either one will be more interesting. You'll probably end up running a Perl webserver in its own process and configuring Apache/IIS/Nginx to proxy to the backend. This isn't as exciting as it sounds once you get it up and running, but it's a different execution model from the CGI fork-process-per-request model you were probably using.

    The other interesting part is that both Dancer and Mojolicious (and most other modern web frameworks) separate "generate HTML/CSS/JS" from "handle incoming query and post data" from "look up data in the database". Back in the day we didn't do that much with CGI and it made a mess for larger applications. The framework will help you keep these concerns separate, manage sessions and login, and maintain persistent database connections. Your job is to manage the logical separation and connections between these various Model, View, and Controller layers. Essentially that means that the first thing you have to figure out is what these frameworks will call "routing", or mapping the URLs exposed in the web app to functions/methods in the Controller layers.

    There's a little bit of stuff to learn, but that should give you a few hints in the right direction.

      I have recently written a quite complex application with Dancer2, and can vouch for its effectiveness. The documentation is very well laid out and easy to follow, and like Mojo, it takes only a few minutes to stand up your first application to get you started by following said fine documentation. The devs are very responsive via many mediums, and has a very large community when one has questions. I have only "played" with mojo very briefly, then decided on Dancer.

      I don't remember the reasons why I went with Dancer now, but I do know that it wasn't based on any negative experiences I had with mojo. Probably because I tried it after mojo, and just kept coding.

Re: Old guy...Looking for advise on web platform selection.
by marto (Cardinal) on Feb 02, 2018 at 21:36 UTC
Re: Old guy...Looking for advise on web platform selection.
by Anonymous Monk on Feb 02, 2018 at 21:27 UTC
Re: Old guy...Looking for advise on web platform selection.
by rizzo (Deacon) on Feb 04, 2018 at 16:11 UTC

    If you are not in the need of a complete framework like Mojolicous or Dancer and due to the fact that you are already familiar to Perl::CGI you should probably have a look at the CGI::Fast Module.

Re: Old guy...Looking for advise on web platform selection.
by Anonymous Monk on Feb 05, 2018 at 18:14 UTC
    It sounds to me like either framework could very easily be pressed into service ... maybe even something more low-level like CGI::Application would be enough in this case. But you really do need to begin by thoroughly mapping out the application itself. (Any database on Earth will have no problem at all with "millions of records," and "thousands of sessions" is also no problem especially if you use memcached to drive them.)

      This is a set of terrible—strangely overly-generic and overly-specific: use any DB, the DB was specified; use memcached, why? how?; CGI::Application? Hacka', please—recommendations that look as though you did not read the OP.

      Reminds me of the best advice I ever got in my professional career. I pass it along for other readers. My supervisor at Amazon said: Answer the question that was asked, not the question you wish had been asked.

      Of course, if you would like to provide a little code, perhaps you could show me where I'm wrong or misunderstanding your advice.

        Nothing in the OP particularly suggests anything that calls for a higher-level framework like Catalyst or Dancer ... CGI::Application and its brethren just might be good enough. Expressed concerns about the number of rows in the database-tables being queried are irrelevant so long as the queries and table-indexes are properly designed. Expressed concerns about the number of sessions are much the same – it will not matter. (Portions of requirements like this one can also be handled using tools like RPC::Any if the decision is made to do most of the presentation client-side using JavaScript.) Frameworks can be very helpful but they also introduce complexity which might not be necessary in an apparently-specialized internal use case like this one seems to be.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1208368]
Approved by Corion
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-12-03 19:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found