Skip to main content
Participating Frequently
Nov 11, 2021 12:43 PM UTC
Question

Query Database node vs write to datasore smart service

Hi All,

We have one scenario where we need to update the one field in one row in database table. Table consist of 50 columns.

Question :What is the best  between below two option

1. Query Database node :can use single update query to update one row in database.

2. Write to datastore smart service :First bring all data in CDT and update value of field and then write CDT to database using Write to Datastore smart service .

Note: There will be only one row to update.

    3 replies

    peter.lewis
    Employee
    Nov 11, 2021 12:58 PM UTC

    I would suggest using write to data store in most scenarios, this one included. The main reason is that the write to data store entity is more natively supported in Appian. For example, the write to data store entity will have impact analysis that links your CDT / Data Store as dependents to this process. Also, it has a native way of tracking and reporting on issues when writing to the database.

    In general I only suggest using the query database node for operations that cannot be performed in the write to data store entity node. Since this is a simple scenario, it's much better suited for the out-of-the-box write to data store.

    vijays250Author
    Participating Frequently
    Nov 12, 2021 6:09 AM UTC

    Thanks Peter, when using "Write to datastore smart service", we need to do two steps ,first  run query entity with all column (50) and then set the vaule in cdt and then call "Write to datastore smart service". Would it make much difference ?

    peter.lewis
    Employee
    Nov 12, 2021 1:54 PM UTC

    Yes that's correct - you must have all the data to write to the database correctly using the write to data store node. I still would strongly recommend this over using the query database node.