Main > Forum > Learning > 1C:Professional questions > Secondary data: persistent vs. virtual

Forum

Search UsersRules
Secondary data: persistent vs. virtual
#1
Just came
Points:: 0
Joined:: Mar 30, 2015

Hi,

what exactly are the pros and cons related to secondary data comparing the persistent
to the virtual variant? Is one of them more efficient or more robust towards future changes?

Profile
#2
Moderator
Points:: 0
Joined:: May 8, 2013

The important thing about secondary data is that they are always calculated, and, obviously, this calculation takes resources. Calculating the secondary data, we are slowing down the system and increasing its response time. The difference between persistent and virtual secondary data is all about when we want the resources to be spent or (which is the same thing) what operation we want (or can afford) to slow down.

Persistent secondary data calculation takes place when primary data are changed, i.e. during write operations (saving and posting documents and so on). Virtual secondary data calculation takes place during read operations (refreshing forms, filling out reports and so on).

Note, that persistent secondary data usually calculated less frequently than virtual secondary data (because data are read more often than they are written), but the calculation itself is more complex.

One more thing to consider is developer's resources. Persistent secondary data calculation takes much more time to implement and maintain. You need to follow specific practices to reduce the likelihood of errors and allow developers to make changes in the code easier. In that sense, virtual secondary data look more natural and less messy.

All in all, it's really hard to say in advance, which type of secondary data is a better choice in each case. Therefore, the most practical advice will be the following: use virtual secondary data until you see that some specific read operation needs to be speeded up. Then introduce the persistent secondary data (only for this specific reading case). Remember, that speeding up the reading you are slowing down the writing, but if you do everything right, this slowing down won't be noticeable.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.