DEVCON 2026    |    2-5 November 2026 – QEII Centre – London, UK    |    Register now! 

Blogs

Is Service Builder Completely Replaceable by Liferay Objects?

Bhargav R Vaghasiya
Bhargav R Vaghasiya
2 minuters läsning

For years, 𝗦𝗲𝗿𝘃𝗶𝗰𝗲 𝗕𝘂𝗶𝗹𝗱𝗲𝗿 was considered the backbone of backend development in Liferay.

Need a custom entity?
Use Service Builder.

Need APIs?
Use Service Builder.

Need persistence, finder methods, services, indexing, permissions, workflows, or business logic?
Again, Service Builder.

It became the default engineering pattern for almost every serious Liferay implementation.

But the ecosystem has changed dramatically.

Today, when I look at modern Liferay architecture, I think a very important question needs to be asked:

▎ Is Service Builder still the primary way to build backend systems in Liferay?

Honestly, for many use cases, the answer is no.

────────────────

𝗧𝗛𝗘 𝗥𝗜𝗦𝗘 𝗢𝗙 𝗟𝗜𝗙𝗘𝗥𝗔𝗬 𝗢𝗕𝗝𝗘𝗖𝗧𝗦

Liferay Objects changed the development experience completely.

Instead of writing large OSGi modules for every business requirement, teams can now create business-driven applications directly from the platform itself.

Objects already provide:

 - Data modeling
 - Relationships
 - Permissions
 - Workflows
 - APIs
 - Validation
 - UI generation
 - Headless access
 - Low-code administration

This removes a huge amount of engineering overhead.

A business requirement that previously needed:

 - Service Builder entities
 - Local services
 - Remote services
 - REST builders
 - JSPs or React UI
 - Permission handling
 - Workflow integration

…can now sometimes be solved in hours using Objects.

That is a massive architectural shift.

────────────────

𝗪𝗛𝗬 𝗦𝗘𝗥𝗩𝗜𝗖𝗘 𝗕𝗨𝗜𝗟𝗗𝗘𝗥 𝗜𝗦 𝗡𝗢 𝗟𝗢𝗡𝗚𝗘𝗥 𝗧𝗛𝗘 𝗗𝗘𝗙𝗔𝗨𝗟𝗧 𝗔𝗡𝗦𝗪𝗘𝗥

One of the biggest mistakes I still see is treating Service Builder as the starting point for every backend requirement.

That mindset made sense years ago.

But modern enterprise systems are evolving differently.

Today’s architectures are increasingly based on:

 - Microservices
 - Headless APIs
 - External platforms
 - Event-driven systems
 - Cloud-native deployments
 - Frontend/backend separation

In this type of ecosystem, Liferay often acts more like:

 - A digital experience layer
 - A business orchestration layer
 - A frontend aggregation platform

not necessarily the place where all backend logic must live.

And this is exactly where:

 - 𝗟𝗶𝗳𝗲𝗿𝗮𝘆 𝗢𝗯𝗷𝗲𝗰𝘁𝘀
 - 𝗖𝗹𝗶𝗲𝗻𝘁 𝗘𝘅𝘁𝗲𝗻𝘀𝗶𝗼𝗻𝘀
 - 𝗘𝘅𝘁𝗲𝗿𝗻𝗮𝗹 𝗦𝗲𝗿𝘃𝗶𝗰𝗲𝘀
 - 𝗛𝗲𝗮𝗱𝗹𝗲𝘀𝘀 𝗶𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗶𝗼𝗻𝘀

start becoming much more powerful than traditional monolithic OSGi development.

────────────────

𝗧𝗛𝗘 𝗣𝗥𝗢𝗕𝗟𝗘𝗠 𝗪𝗜𝗧𝗛 𝗢𝗩𝗘𝗥𝗨𝗦𝗜𝗡𝗚 𝗦𝗘𝗥𝗩𝗜𝗖𝗘 𝗕𝗨𝗜𝗟𝗗𝗘𝗥

Service Builder is extremely powerful.

But power is not always the correct architectural choice.

Large Service Builder-heavy projects often create:

 - Tight coupling with portal runtime
 - Complex deployments
 - OSGi dependency challenges
 - Upgrade difficulties
 - Slower development cycles
 - Harder scalability patterns
 - Platform lock-in

And honestly, many modern backend concerns are handled far better today using dedicated external services.

For example:

 - High-volume processing
 - AI integrations
 - Payment orchestration
 - Analytics engines
 - External ERP synchronization
 - Distributed workflows
 - Event streaming

These workloads naturally fit microservice architectures more than portal-contained business logic.

────────────────

𝗦𝗢 𝗜𝗦 𝗦𝗘𝗥𝗩𝗜𝗖𝗘 𝗕𝗨𝗜𝗟𝗗𝗘𝗥 𝗗𝗘𝗔𝗗?

Not at all.

Service Builder still has very strong use cases.

It remains valuable when:

 - Deep portal integration is required
 - Internal Liferay persistence is necessary
 - Tight coupling with platform services is beneficial
 - Advanced indexing/custom search control is needed
 - Existing enterprise implementations heavily depend on it

But I no longer see it as the “default architecture.”

That’s the key difference.

────────────────

𝗪𝗛𝗔𝗧 𝗠𝗢𝗗𝗘𝗥𝗡 𝗟𝗜𝗙𝗘𝗥𝗔𝗬 𝗔𝗥𝗖𝗛𝗜𝗧𝗘𝗖𝗧𝗨𝗥𝗘 𝗟𝗢𝗢𝗞𝗦 𝗟𝗜𝗞𝗘

In my opinion, modern Liferay development is moving toward this combination:

 - 𝗟𝗶𝗳𝗲𝗿𝗮𝘆 𝗢𝗯𝗷𝗲𝗰𝘁𝘀 for business-driven configuration
 - 𝗖𝗹𝗶𝗲𝗻𝘁 𝗘𝘅𝘁𝗲𝗻𝘀𝗶𝗼𝗻𝘀 for frontend/backend flexibility
 - 𝗛𝗲𝗮𝗱𝗹𝗲𝘀𝘀 𝗔𝗣𝗜𝘀 for interoperability
 - 𝗘𝘅𝘁𝗲𝗿𝗻𝗮𝗹 𝗠𝗶𝗰𝗿𝗼𝘀𝗲𝗿𝘃𝗶𝗰𝗲𝘀 for scalable business logic
 - 𝗟𝗶𝗳𝗲𝗿𝗮𝘆 𝗮𝘀 𝗮𝗻 𝗼𝗿𝗰𝗵𝗲𝘀𝘁𝗿𝗮𝘁𝗶𝗼𝗻 𝗮𝗻𝗱 𝗲𝘅𝗽𝗲𝗿𝗶𝗲𝗻𝗰𝗲 𝗽𝗹𝗮𝘁𝗳𝗼𝗿𝗺

This creates:

 - Cleaner separation
 - Faster delivery
 - Independent deployments
 - Better scalability
 - Easier modernization
 - Technology freedom

And honestly, this approach aligns much more closely with modern enterprise engineering principles.

────────────────

𝗙𝗜𝗡𝗔𝗟 𝗧𝗛𝗢𝗨𝗚𝗛𝗧𝗦

I don’t think the future is:

▎ “Objects replacing Service Builder.”

I think the future is:

▎ “Architectures becoming less portal-centric.”

And in that world, Service Builder becomes one tool among many — not the center of the entire backend strategy.

That’s the real shift happening in the Liferay ecosystem right now.
 

Kommentarer

we are using Liferay 7.4 GA132 with MariaDB 11.4.5 and utf8mb4.

We are trying to publish a custom Object called ProjectInformation that contains multiple Multiselect Picklist fields. Publishing fails with:

Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.

After checking the generated database statement, we saw that Liferay creates Multiselect Picklist fields as varchar(5000). With utf8mb4, each of those fields can take up to 20,000 bytes. So after only a few Multiselect Picklists, the MariaDB/InnoDB row-size limit is reached.

What is confusing is that older Object tables still have Multiselect Picklists as varchar(280), but newly created Objects now get varchar(5000). According to the documentation, this limit was increased from 280 to 5000 in newer Liferay versions.

Our questions are:

  1. Is there a supported way to configure the size of Multiselect Picklist fields, e.g. back to 280?

  2. Is varchar(5000) expected behavior in Liferay 7.4 GA132?

  3. What is the recommended solution when many Multiselect Picklists are needed in one Object?

  4. Is there a supported workaround besides splitting the data into multiple Objects or building a custom UI?

Splitting into multiple Objects would be difficult for us, because the standard Object/Form UI displays fields from one Object directly, while relationships are shown in separate tabs. We need the information to appear together in one form.

Has anyone else run into this issue?

Hello,

Here, I am trying to provide you approaches that will be best suitable for your case

1. Is there a supported way to configure the size of Multiselect Picklist fields, e.g. back to 280?  -- Not from UI; you need to change it from DB (Not recommanded)

2. Is varchar(5000) expected behavior in Liferay 7.4 GA132?  -- YES

3. What is the recommended solution when many Multiselect Picklists are needed in one Object?  -- When you save object entry, liferay save "key's" of picklist (comma seperated in case of multiselect picklist).   -- Use smaller unique values for the key if possible(you can use numbers) and you can provide proper labels (to display in UI)  -- It will help you to select lots of picklist value while creating object entry

4. Is there a supported workaround besides splitting the data into multiple Objects or building a custom UI?  -- If you follow approach mentioned in question 3, you can use OOTB UI  -- If you can not use smaller values for Key, you might need to use one-to-many relationship.  -- By doing this, your picklist will become an object definition.  -- You can use Liferay's API to get nested fields with the same API calls, which will reduce frontend API calls.

The problem is that if we want to publish the object with five multi-select picklists, Liferay tries to create a table for this object with a VARCHAR(5000) column for each picklist. This happens regardless of what we use as the key for the picklists. As a result, we get the following error:

'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs.'

Therefore, the approach mentioned in point 3 is not realistic.

The approach 4 will be the overkill for me, becuase in Object-Layouts, we cannot use Objects in Multipicklists. :)

 

Related Assets...

Inga resultat hittades

More Blog Entries...