This is one of the most common Pega interview questions for a reason.
OBJ and RDB methods both interact with databases. But they work differently, serve different purposes and come with different trade-offs. Understanding when to use each one is fundamental to writing well-structured Pega activities.
The Core Difference – Internal vs External Tables
OBJ methods work with both internal and external database tables – as long as there is a class mapping in place. Internal tables are the ones that live in Pega’s own rule and data schemas. External tables are tables in a separate database that you have mapped to a Pega class using the class mapping wizard.
If a class is mapped to a table, use OBJ. If there is no class mapping and you need to query an external database directly, use RDB.
Why OBJ Is Preferred
OBJ methods do not require you to write SQL. You configure the method – the filter criteria, the browse conditions, the key – and Pega generates and executes the SQL query at the back end. No SQL knowledge needed. Fully low-code.
RDB methods require you to create a Connect SQL rule and write the query yourself. You need at least basic SQL skills. More configuration, more maintenance, more risk of errors.
Beyond the SQL question, OBJ methods give you access to blob data – the compressed complex structures Pega stores for embedded page properties and page lists. Querying blob data through RDB methods requires PL/Java functions and is significantly more complex.
The most important advantage of OBJ methods is transaction management. When you use OBJ save or OBJ delete, you can defer the commit. The change waits until the full transaction completes. If something goes wrong partway through, you can roll back cleanly. RDB methods auto-commit immediately. There is no deferred transaction, no rollback. What is done is done.
When to Use RDB
There are two scenarios where RDB methods are the right choice.
The first is when you need to run complex queries that cannot be expressed through OBJ method configurations – multi-table joins, subqueries, complex aggregations.
The second is when you need to execute a stored procedure on an external database. OBJ methods cannot call stored procedures. RDB methods can.
Outside of those two scenarios, always use OBJ. Pega recommends it, and for good reason.
Watch the Full Walkthrough
In the video below I walk through all five differences in detail, with examples of how each method works in an activity rule configuration.
OBJ vs RDB comes up in interviews because it tests whether you understand how Pega interacts with databases – not just how to drag and drop in Dev Studio. This video gives you the full picture.
