• Liferay DXP
  • Objects
  • Architecture

Liferay Objects vs Service Builder: how to choose in 7.4

When to model data with Liferay Objects and when Service Builder is still the right tool — a decision guide covering APIs, workflow, permissions, performance, upgrades and real project trade-offs.

By Jainesh Patel7 min read

Since Liferay 7.4 there are two serious ways to model custom data. Liferay Objects are created in the UI or deployed as configuration, and come with storage, APIs, permissions and workflow built in. Service Builder generates a persistence and service layer in your own OSGi modules, giving you full control in Java. Both are valid. Choosing well per entity saves weeks.

What Objects give you

  • Speed. Fields, relationships, picklists and validations in hours, not days.
  • APIs for free. Every Object definition gets Headless REST and GraphQL endpoints automatically.
  • Platform features built in. Permissions, workflow, actions, notifications and audit behaviour without custom code.
  • Page-builder integration. Display and edit Object data with Collections, Fragments and form containers — editors can build screens themselves.
  • Upgrade safety. Objects are platform configuration, not custom code compiled against internal APIs.

What Service Builder gives you

  • Full control. Your own tables, finders, custom SQL and service methods in plain Java.
  • Real transactions. Multi-entity business logic inside one transactional service call.
  • Performance tuning. Indexes, caching and query shapes you design for your data volume.
  • Maturity. A long track record and plenty of existing modules that already depend on it.

The cost: you own that code, its tests and its behaviour through every future upgrade.

A decision table

QuestionObjectsService Builder
Mostly CRUD, forms and approvals?Best fitOverkill
Business users should evolve the model?YesNo — needs a developer
REST and GraphQL APIs needed?GeneratedBuild with REST Builder
Complex multi-entity transactions?LimitedBest fit
Custom SQL or heavy reporting queries?LimitedBest fit
Extending existing Service Builder modules?—Natural choice
Liferay SaaS, where custom OSGi modules aren't allowed?WorksNot available

My rule of thumb

Start with Objects for business data that is mostly create-read-update-delete plus forms, permissions and workflow. Reach for Service Builder when you need complex transactions, custom SQL, very large tables with tuned indexes, or when you're extending modules that already use it.

Most real projects mix both — and that's fine. A common shape is Objects for the data model, with heavier logic in an Object action that calls a microservice client extension or a Java service.

What this looked like on real projects

On a government land allocation platform with a 24-level approval chain, Service Builder and custom portlets gave us the control we needed over a deep, document-heavy process. On an event travel portal, Objects, Client Extensions and Fragments let us ship forms, approvals and dashboards quickly, on an architecture that stays friendly to future upgrades.

Moving existing entities to Objects

It's possible to move Service Builder data into Object definitions using Liferay's Headless batch APIs. Plan carefully for permissions, relationships and identifiers, and migrate one entity at a time with the old module still available as a fallback.

Not sure which approach fits your data model? I help teams design and build Liferay DXP solutions — send me your requirements and I'll recommend an approach per entity.