Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
16fbd32a
Unverified
Commit
16fbd32a
authored
7 years ago
by
Manish R Jain
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update index.md
Remove confusing transaction and versioning note.
parent
6b889221
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wiki/content/design-concepts/index.md
+0
-46
0 additions, 46 deletions
wiki/content/design-concepts/index.md
with
0 additions
and
46 deletions
wiki/content/design-concepts/index.md
+
0
−
46
View file @
16fbd32a
...
@@ -201,52 +201,6 @@ Every time we regenerate a posting list, we also write the max commit log timest
...
@@ -201,52 +201,6 @@ Every time we regenerate a posting list, we also write the max commit log timest
included -- this helps us figure out how long back to seek in write-ahead logs when initializing
included -- this helps us figure out how long back to seek in write-ahead logs when initializing
the posting list, the first time it's brought back into memory.
the posting list, the first time it's brought back into memory.
### Note on Transactions
Dgraph does not support transactions at this point. A mutation can be composed of multiple
[
Edges
](
{{
<
relref
"
#edges
"
>
}}), each edge might belong to a different
[
Posting List
](
{{
<
relref
"
#posting-list
"
>
}}). Dgraph acquires
`RWMutex`
locks at a posting list
level. It DOES NOT acquire locks across multiple posting lists.
What this means for writes is that some edges would get written before others, and so any reads
which happen while a mutation is going on would read partially committed data. However, there's a
guarantee of
[
**durability**
](
https://en.wikipedia.org/wiki/ACID#Durability
)
. When a mutation
succeeds, any successive reads will read the updated data in its entirety.
On the other hand, if a mutation fails, it's up to the application author to clean the partially
written data or retry with the right logic. The response from Dgraph would make it clear which edges
weren't written so that the application author can set the right edges for retry.
**Ways around this limitation**
*
You should determine if your reads need to have transactional
[
atomicity
](
https://en.wikipedia.org/wiki/ACID#Atomicity
)
.
Unless you are dealing with financial data, this might not be the case.
*
To ensure atomicity, you could have only one edge (RDF NQuads) per mutation. This would mean more
network calls back and forth between client and server which would affect your write throughput, but
would help make the failure handling logic easier.
### Versioning
Broadly speaking, there're two kinds of data stored in Dgraph. One is relationship data; other is value data.
```
Me friend person0 [Relation]
Me name "Константи́н" [Value]
```
The way Dgraph stores
[
Posting List
](
{{
<
relref
"
#posting-list
"
>
}}), the relationship data gets
converted to UIDs and stored in a sorted list of increasing uint64 ids to allow for efficient
traversal, lookups, and intersection.
Versioning involves writing deltas and reading them to generate the final state. This isn't as
effective when you're dealing with millions of UIDs and want to do the operations mentioned above.
It would be too slow and memory-consuming to re-generate the long posting lists for every read operation.
For those reasons,
**versioning wouldn't be supported for relationship data.**
On the other hand, we only expect one value per
`subject-predicate-language`
composite. This allows
us to store many versions of this value in the same posting list, without having to do any
regeneration. So, we can potentially support versioning of value data.
{{% notice "warning" %}}Value data versioning is under consideration, and not yet implemented.{{% /notice %}}
### Queries
### Queries
Let's understand how query execution works, by looking at an example.
Let's understand how query execution works, by looking at an example.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment