When is it beneficial to have multiple Play applications instead of one monolithic one?

StackOverflow https://stackoverflow.com/questions/4024576

  •  26-09-2019
  •  | 
  •  

Question

I've settled on the Play framework for the rewrite of our intranet portal. Our portal contains a lot of loosely related stuff so I'm looking for advice on if or how to break it into multiple Play applications.

What are the consequences of making it multiple applications? Is single sign-on still possible? How is access control affected? Am I likely to have to duplicate a lot of code/configuration between them? What else should I consider when deciding where to split things apart?

Was it helpful?

Solution

First of all I would think about modules, because otherwise you must start a lot of applications, which increase memory consumption. Only if your site is heavy loaded, so that you need multiple server, this doesn't matter.

Is single sign-on still possible? I would say, yes. You can store the data in a cookie, but must make sure that other urls can read it.

Am I likely to have to duplicate a lot of code/configuration between them? Well if you use similar databases this would be another drawback compared with modules, but I wouldn't be to worry about this 1 file of configuration. Code which needed in more than one application can be easily shared via jar-files as a library or you use modules for this.

OTHER TIPS

I've since discovered that being stateless on the server side means Play uses HMAC hashes stored in cookies along with the username to keep track of sessions. If multiple Play applications are to be authenticated against the same set of credentials (OpenLDAP in my case), they just need to have the same application.secret configured in conf/application.conf in order to achieve single sign-on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top