Skip to main content
June 3, 2024
Question

What is disadvantages of query database smart service

  • June 3, 2024
  • 19 replies
  • 0 views

hi

I would like to ask a question.

What is the disadvantages of query database smart servie.Which point is better than record type?

Is there anything better than record type?

Thanks

19 replies

shubhama926776
Brainy
June 3, 2024

What is your use case?
Query databases and record types are not directly comparable; they serve distinct purposes.

शुभम्
davidj137213
Brainy
June 3, 2024

EAch one of them are totally different, and serves for different purposes.. even when both of them works againt database....

venkatrea696188
June 3, 2024
even when both of them works againt database..

Just to add to David's  point . Record data with Sync enabled stored in Appian Memory (It's like a Cache data). 

What is the disadvantages of query database smart servie

I can say direct Database interactions . Where as when you Query Records you are not hitting DB directly

davidj137213
Brainy
June 3, 2024

When you work with Record Types, you work with an strcutured data model, but when you work with query database you are working with queries.

For example, if you have two records in Appian, but you need two execute an SP, a view, or just a query with an special agregation, you use queryDatabaseSmartService....even when you are working with the same tables...

konduruc733182
June 3, 2024

I will not say those are disadvantages as others have mentioned earlier. Each serve its purpose.

The main difference would be that when querying from records, you are trying to get the data from the memory i.e., cache which gives you a quicker response. Also you would not perform a direct query on the database.

Heres something from the documentation which will make it clear

"Data sync caches your source data in Appian.

Think of it like a cache on your web browser: when you cache web content locally on your browser, your site content loads faster and improves the speed of your browsing. The same applies when you sync your source data—Appian only has to execute queries against your synced data instead of the external source, so your record data will load faster. In addition to faster queries"

https://docs.appian.com/suite/help/22.2/records-data-sync.html#how-does-data-sync-work

peter.lewis
Employee
June 3, 2024

The main thing to remember is that the the Query Database smart service uses SQL, while querying and writing data through records uses the structure of the data model you've already defined in your application, which should make it easier and faster.

Since Appian is a low-code platform, using records is our low-code method of interacting with your database and other systems. At this point I'd only recommend using the Query Database smart service if something isn't obviously supported through records (which is getting pretty rare at this point).

Can you give some more context to the question? Are you trying to make a decision on which one to use?

girlc0001Author
June 3, 2024

 [mention:6b9f80ff18f9420082d13ef2d5121d56:e9ed411860ed4f2ba0265705b8793d05] 

Thanks you for your response.

In our system's database structure there are many places where recordtype relationships are not possible.
In our system, the usage rate of the query database smart service is expected to be approximately 70%.
I'm worried about it's okay or not.I'm looking for a better way.

peter.lewis
Employee
June 3, 2024
In our system's database structure there are many places where recordtype relationships are not possible.

Why not? Can you provide more context?

In our system, the usage rate of the query database smart service is expected to be approximately 70%.

Also can you give more context to this one? I'm not exactly sure what usage of 70% means - 70% of what?

mikes0011
Brainy
June 3, 2024

The Query Database smart service is pretty horrible - cumbersome, unflexible, and also fairly dangerous in the wrong hands.  I practically never use it if it can be avoided at all.  The only time I ever willingly use it is to execute a specialty SQL statement that checks the next available ID in a database and reserves an entry using that row at the exact same time, to avoid a weird race condition.  And under most circumstances this can just be done with a regular Query Entity call and clever process node arrangement.

For everything else, you should be using Query Entity (since you said RecordType data is not usable to you - if it were, it'd probably be best to be using that at this point).  I don't know of any reason to ever use the Query DB smart service when you could be reading and/or writing using Entity data.  I know there are some extreme edge cases, but they're rare at best.

The Expression Guru