I am just wondering if Attribute Validation is better with Database Trigger or Arcade.
Suppose I want to do Attribute Validation about the value of one coloumn that depends on the value of another coloumn OR maybe I want to limit the data entry of a coloumn OR maybe I want to populate a date coloumn automatically.
In a scenario in which the data (stored in SDE) have to be accessed by many people via Map / Feature Service, which one is more suitable in term of fastness and reliability ? What are the considerations in choosing a particular method ?
Thank you
Hi @yockee,
I don't typically use validation rules simply because the workflows that we have generally will account for all the edits that come in from the field. Typically validation is mostly for verifying that the data that is entered meets a certain criteria.
It is usually best to create calculations that will account for certain things rather than try and force the editor to fill in the information. The solutions that we have created automatically account for certain behaviors and so there isn't a need to for validation.
The other thing is if you are concerned with certain types of edits then you could try and create a constraint rule instead. The benefit of a constraint rule is that you can customize messages will appear to the editors and letting them know what needs to be corrected in order to continue editing.
The attribute rule is going to be more reliable and have a better user experience, especially if you're working with data that is versioned or coming in through mobile workflows. You can even make some attribute rules available to mobile users when they are offline, so even when they're editing a local copy of the data integrity is still enforced.
@RobertKrisher any technical insight regarding why one is better than another one ?
I am thinking that database trigger works on Database Tier, whereas the Attribute Validation works on Server Tier. So the the database tier will work better because it is more efficient.
But I dont know how this Attribute Validation works in Map Feature Service ? The Attribute Validation never gets published as service but how can it work when one access the data via Map Feature Service ? Where is it stored ? On the other hand, database trigger can be seen as database object in the database.
I need more explanation. Thanks
So the way attribute rules work is similar to sql triggers. Because of this, any edits done to a record will trigger some kind of response if one is set. Validation simply checks to see if any of the incoming edits do not meet a certain criteria and can either warn or flag for certain issues. This won't keep the data integrity if that is of more importance. Rules, either constraint or calculation, will best serve your needs.
The other thing, regarding rules, is that they can either be application dependent, such as the case with most offline use, or that can be set to server only. Meaning when an edit is applied, if client side, it will only run on that instance whether it be tablet or phone, but if it is server side then it will update via the server and return the change after it passes server side.
Server side is typically used for checking against other tables/features or the features base table that would require the change be pushed to the server. It is then checked for changes either applied or attributes pulled from the other features, applies changes, and then returns and changes to the version used by the field.
The attribute rule is stored in the geodatabase and is exposed through a validation service to clients. There is also the ability to choose between enforcing rules client-side, or server-side only. I recommend you do some research on attribute rules and the validation service.
"The attribute rule is stored in the geodatabase and is exposed through a validation service to clients"
1. Where can I see the attribute rule in the geodatabase ?
2. What is the validation service looks like ? Is it a some sort of wer services ? I need to see the object.
1. Create and manage attribute rules—ArcGIS Pro | Documentation
2. Before worrying too much about the backend (REST), I recommend you read more about the capability: Validation attribute rules—ArcGIS Pro | Documentation
The main reason I am worrying too much is that the Portal is hosted on cloud (AWS).
FYI, any traffics that enter / leave to / from Portal will generate expenditure for us. I am talking about a really heavy traffic.
So, I need to spread the balance between the servers, DB and Portal. I am hoping that the Attribute Validation, if it is runs in the Portal server, is implemented on the DB via Trigger.
I hope that your database is also in AWS, and that you've read the guidance in the ArcGIS Architecture Center. Specifically, about the importance of minimizing the latency between the ArcGIS Enterprise and the Database Server.
The attribute rules can be configured to run on the client side or the server side. When they are run client-side they still need to make queries to the ArcGIS Server to satisfy the data requests. When the rules are run server-side they run on ArcGIS Server.