Framavox
Mon 16 Apr 2018 12:37PM

Turn Koha into a Mojolicious application

JM Julian Maurice Public Seen by 41

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20582

Pros:
- Builtin webserver
- No need for Apache2/Nginx in development
- Simpler Apache2/Nginx configuration in production
- Testable CGI scripts with Test::Mojo
- Starman and Plack middlewares can still be used
- URL rewriting and static files serving in the app means easier upgrades (no external configuration file to update - see Bug 12904)
- All Mojolicious features (routing, commands, plugins, ...)
- No new Perl dependencies

Cons:
- Koha will be tied to a specific framework
- It's a fast moving framework so there's an overhead to that with regards to maintaining the debian dependency and also keeping the code up to date with the latest developments in the framework

Please add your pros and cons in comment.

DC

David Cook Sun 22 Apr 2018 11:55PM

Oh, using Mojolicious would be no worse than a Plack setup. I was just thinking that Mojolicious might make the move to Plack easier.

As for being multitenant, Koha would need to be able to compartmentalize data better. Srdjan was doing work on this that he posted to Bugzilla. The main issue is global variables and singleton objects.

With Plack, you can only put N instances of Koha on a server before you'd run out of memory at the very least.

M

Martin Tue 15 May 2018 11:40AM

Yeay, lets drag Koha out of 1999 kicking and screaming.. I'd love to be aloud to use Mojo in all it's glory and have allot of knowledge I could bring to the party regarding Mojo :)

M

Martin Tue 15 May 2018 11:42AM

I would love to see some effort going into learning about the core features of Mojo though.. right now we're not making the most of a fair few area's of the framework and we're not thinking in a non-blocking way at all as far as I can tell.

M

Martin Tue 15 May 2018 11:44AM

The only con I see is the same one I raised when we chose to go with Mojo for the API.. it's a fast moving framework so there's an overhead to that with regards to maintaining the debian dependency and also keeping the code up to date with the latest developments in the framework.

M

Martin Tue 15 May 2018 11:50AM

It might encourage the use of method chaining and more modern coding practices too which is only a good thing in my opinion... out of interesting are you thinking of using Mojo's template engine too or a full blown slow migration to splitting frontend and backend into disparate codebases...

JM

Julian Maurice Tue 15 May 2018 12:42PM

are you thinking of using Mojo's template engine too or a full blown slow migration to splitting frontend and backend into disparate codebases...

Mojolicious can be told to use Template::Toolkit as its default rendering engine, so I think we should continue to use that.

Splitting frontend and backend might be nice but I think that Koha is far from ready for that. Using a full-featured framework might help, but that's not the objective here.

M

Martin Tue 15 May 2018 12:49PM

Brill.. baby steps and all that.