Where — on what level — the locking and collisions occur in transactional operations on the same entity group? At root? At some common, wide enough parent?
It's not clear to me what is an "Entity Group" for a transaction. Is it always a group originating at a root entity (without parent) or is there a mechanism that selects a group wide enough for transaction.
For example when I have a model structure like this:
- School
- Teacher
- Class
- Course
- Lesson
- Evaluation
- Student
- Guardian
- Grade
- PresenceMarker
- TextBook
Do my transactional operations always refer to "Entity Group" as a group originating at a school level (regardless of the level where actual operation occur), or when I update students entities in the same class, I can only collide with with other transactional operation occurring below the same class entity.
In other words is there only one entity group staring from School or are there sub entity groups originating at every other level in the hierarchy? If there are sub entity groups, are they used in the for transaction isolation?
UPDATE:
Taking Sharding counters as an another example. Will the sharding work if all the shards have common parent? Will updating a single counter shard result in transaction collisions updates on other shards?