LIFERAY BEST PRACTICES – PART 1

Developers and managers both struggle at times to pre-plan usage of best practices in projects causing many problems which are best avoided. Providing below some learnings & best practices on using and working with Liferay – Part 1.

  • Don’t work directly on the Liferay database. Use the groovy script console in CONTROL PANEL or the Liferay User Interface. Use the database at the max as a READ ONLY tool for analysis and debugging – even this is for extreme cases when recommended like for problems in reindexing and such for BackgroundTaskTable or Lock_ as per Help Center articles only. Stick to Liferay APIs (REST or Java / Groovy – based) for right results. Changing anything at database level can have unintended consequences which are best avoided.

  • If you need a cloud offering, instead of deploying Liferay on AWS / GCP / Azure or similar on your own which can be a valid option, also consider and evaluate one of Liferay DXP Self Hosted, Liferay Experience Cloud Self-Managed or Liferay Experience Cloud. They are built on top of GCP with many advanced features pre-baked like CI/CD depending on the version you select. Liferay’s cloud offering decrease many of the efforts of upgrades, infrastructure, security, patches, CI/CD, monitoring and more depending on which option you select.

  • Use as many out of the box features as possible, followed by configuration and lastly customization. There are 100s and 1000s of direct and indirect features for Liferay available on it’s documentation site.

  • Support tickets are for Liferay product issues, reach out to Customer Success for short term engagements up to multi-month configuration, system administration, customization, audits and such areas. Global services is for executing projects, SME engagements to embed a Liferay expert into your team for technical help, team augmentation, custom packages to support upgrades, performance tuning, DevOps/Architecture kickstarts, long- and short-term customization development, etc. on Liferay. Reaching out to the right team maximizes chances of a fast resolution for your request. For support issues, refer this blog: https://liferay.dev/blogs/-/blogs/working-with-liferay-support

  • Maintain a DevOps / DevSecOps / Repository strategy. Use best practices of code merging, quality and more.

  • Maintain a list of customizations, custom APIs (REST) and modules that are deployed.

  • Consider headless if you want extreme performance or a very specific User Interface with a non standard JS library or you want to connect with an external app with Liferay as the engine or want a very high LightHouse score. Even without headless high scores are possible in most areas.

  • Understand LightHouse and PageSpeed Insights score. There are many hidden things which are NOT OBVIOUS – for example mobile performance scores. Consider investing in parallel into an in-house monitoring tool as well.

  • Upgrades need preparation and multiple dry runs. Bad data, orphan data and bad customizations create problems in upgrade. So use Liferay in the optimum way as per documentation.

  • Keep regular watch on End of Life support and premium / extended support phases. Pre-plan your upgrades by at least one+ years.

  • Lift and shift from in-prem to cloud is not a healthy approach using AMIs. Consider setting up Liferay again via backups if you are shifting to AWS/GCP/Azure from in-prem. Otherwise consider Liferay Experience Cloud, migration would still be needed though.

  • Search & database server should be monitored and optimized on routine basis.

  • Search optimization needs to be a regular habit by the Liferay Administrator as the content and documents get updated. Explore concepts like suggestions, boosting, queries, filters, blueprints and more.

  • SSO, Authentication, Authorization, Login and Security need advance planning and design. These topics vary widely from customer to customer.

  • There are many inbuilt apps in areas of collaboration, social, workflow, content, process, documents and more. Explore and use them before doing customizations.

  • Explore Liferay marketplace for technical & functional accelerators / solutions before investing in developing from scratch.

  • Maintain documentation for your architecture, design, customizations, testing, security, code quality and other areas.

  • Understand and study portal & system properties, they have many settings which can help in managing various scenarios directly by configuration only.

  • Explore Liferay University and trainings on it.

  • Clustered environments are possible in Liferay and consider planning for them right during your architecture, design phase at the start of project rather than later.

  • Consider usage of Advanced or S3 filestore, Clustering, Headless, Liferay DevStudio, Docker images of Liferay, Virtual instances and similar advanced concepts as need be from early in the project.

  • Understand Liferay architecture, tooling and internals like Portlets, OSGi, Liferay DevStudio, Configurations, Control Panel, Gogo Shell, Module projects, Dependencies, Modularity and such.

  • Your important directories and areas in Liferay are: Liferay Home and sub-directories, Filestore / document library – data folder, Custom modules, Configuration files in Liferay Home sub/directories, Search server, Control Panel, Database, Other peripheral configuration areas like load balancer, application server, networking, clustered environments and such.

  • Learn to use the Liferay forums, Liferay Blogs, Liferay GitHub, Liferay Help Center, Liferay Community site, Customer & Partner portals of Liferay well. Lot of useful information is available there.

  • There are in-built areas in the same integrated DXP installation from 7.4 onwards for Digital experience, Portal, Commerce with Analytics. Consider using them from DXP platform before doing customizations for features that are available already.

  • Explore concepts like debug patch, logging per module and overall logging in Liferay.

  • Reach out to community slack channel - https://liferay-community.slack.com/ which can be a great way to further connect with Liferay resources.

  • Keep your portal & components updated with relevant patches & upgrades as per advisory from Liferay.

  • Refer Liferay resources page with case studies & whitepapers. It has useful information on cloud migration, compatibility matrix, benchmarking, what customers are doing with Liferay and more.

References:

  • https://help.liferay.com/hc/en-us

  • https://liferay.dev/

  • https://learn.liferay.com/dxp/latest/en/liferay-internals.html

  • https://learn.liferay.com/dxp/latest/en/index.html

  • https://help.liferay.com/hc/en-us/categories/5843406636941

  • https://marketplace.liferay.com/

  • https://www.liferay.com/liferay-experience-cloud

  • https://learn.liferay.com/dxp-cloud/latest/en/index.html

  • https://www.liferay.com/resources/case-studies

  • https://www.liferay.com/resources

Blogs

A few updates:

* Database - it is best not to even look at the database, don't try to treat as a read-only view. Liferay does things in the data that are easy to misunderstand. Stick with the APIs for best outcomes. * Support - Follow my recommendations: https://liferay.dev/blogs/-/blogs/working-with-liferay-support * GS - Global Services is more than just executing projects. We have SME engagements to embed a Liferay expert into your team for technical help, we do team augmentation, we have custom packages to support upgrades, performance tuning, devops/architecture kickstarts, long and short term customization development, etc. * Liferay Forums/Ask, etc: You didn't add the community Slack channel which I use a lot and can be a great way to further connect with Liferay resources.  

* Database - it is best not to even look at the database, don't try to treat as a read-only view. Liferay does things in the data that are easy to misunderstand. Stick with the APIs for best outcomes.

* GS - Global Services is more than just executing projects. We have SME engagements to embed a Liferay expert into your team for technical help, we do team augmentation, we have custom packages to support upgrades, performance tuning, devops/architecture kickstarts, long and short term customization development, etc. 

Hi Neil,

Thank you for sharing.

I am new to liferay and currently we are developing an Intranet portal. I just started using the existing basic features and haven't gotten into development/coding yet. But I was frustrated when I asked in the "Ask" forum. The last dozens of questions no one answered.

What's your comment about this?

Regards,

[bayu]

Hey Bayu!

Different folks/teams work out of different places. Olaf is king of Stack Overflow, for example. Both he and I are active on the community slack channel. Others are active in Ask.

I haven't seen any of your questions, so I don't know what they were about, but you could try posting to the community slack and see if you can get some hits there...

The community aspects require community participation; we do all we can to help the community, but we also rely on community members to participate as much as they feel comfortable doing...

Hi David,

Thanks for letting me know another source, I'll try to ask there.

Here my two questions on Ask:

https://liferay.dev/ask/questions/portal/object-definition-not-display-correctly-on-role-creation-page (20 Feb 2023)

https://liferay.dev/ask/questions/portal/openid-connect-unable-redirect-to-provider-s-sign-in-page (27 Feb 2023)

About the community aspects, I totally agree with you. Thank you!

Hi Bayu,

Community Slack channel might be a good place to get into conversations as mentioned by David. Regards, Neil 

Hi Neil,

I'm new on Slack and just join a week ago, what's the Liferay channel name and how to join. I found this but it might outdated. A New Way To Connect With The Liferay Community - Liferay

Thanks,