Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
koculu committed Aug 31, 2022
1 parent e36676c commit eaea453
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Benchmark for all modes: [benchmark](https://raw.githubusercontent.com/koculu/Zo
| str-str ZoneTree sync-compressed WAL | 1752 ms | 3397 ms | 5070 ms | 19153 ms |
| str-str ZoneTree sync WAL | 3488 ms | 7002 ms | 10483 ms | 38727 ms |
||
| RocksDb sync WAL | NOT SUPPORTED |
| RocksDb sync WAL (10K => 11 sec) | ~1.100.000 ms | N/A | N/A | N/A |
| int-int RocksDb sync-compressed WAL | 8059 ms | 16188 ms | 23599 ms | 61947 ms |
| str-str RocksDb sync-compressed WAL | 8215 ms | 16146 ms | 23760 ms | 72491 ms |
||
Expand All @@ -61,12 +61,12 @@ ThresholdForMergeOperationStart = 2_000_000;

Additional Notes:
According to our tests, ZoneTree is stable and fast even with big data.
Tested up to 200M records in desktop computers till now.
Tested up to 1 billion records in desktop computers till now.

### ZoneTree offers 4 WAL modes to let you make a flexible tradeoff.

* The sync mode provides maximum durability but slower write speed.
In case of a crash/power cut, the sync mode ensures that the inserted data is not lost. RocksDb does not have sync WAL mode. It has a WAL mode similar to the sync-compressed mode. ( reference: [rocksdb.org](http://rocksdb.org/blog/2017/08/25/flushwal.html) )
In case of a crash/power cut, the sync mode ensures that the inserted data is not lost.

* The sync-compressed mode provides faster write speed but less durability.
Compression requires chunks to be filled before appending them into the WAL file.
Expand Down
4 changes: 2 additions & 2 deletions src/ZoneTree/Core/ZoneTree.Iterators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public IZoneTreeIterator<TKey, TValue> CreateReadOnlySegmentsIterator(bool autoR
}

/// <summary>
/// Creates an iterator that enables scanning of the in memory segments.
/// This includes readonly segments and segment zero (mutable segment).
/// Creates an iterator that enables scanning of the in-memory segments.
/// This includes read-only segments and mutable segment.
/// </summary>
/// <param name="includeDeletedRecords">if true the deleted records are included in iteration.</param>
/// <returns>ZoneTree Iterator</returns>
Expand Down
12 changes: 6 additions & 6 deletions src/ZoneTree/Core/ZoneTree.Merge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ public sealed partial class ZoneTree<TKey, TValue> : IZoneTree<TKey, TValue>, IZ
/// <summary>
/// Moves mutable segment into readonly segment.
/// This will clear the writable region of the LSM tree.
/// This method is thread safe and can be called from many threads.
/// The movement only occurs
/// if the current segment zero is the given segment zero.
/// This method is thread-safe and can be called from many threads.
/// The movement only occurs if the current mutable segment
/// is the mutable segment passed by argument.
/// </summary>
/// <param name="mutableSegment">The segment zero to move forward.</param>
/// <param name="mutableSegment">The mutable segment to move forward.</param>
void MoveMutableSegmentForward(IMutableSegment<TKey, TValue> mutableSegment)
{
lock (AtomicUpdateLock)
{
// move segment zero only if
// the given segment zero is the current segment zero (not already moved)
// the given mutable segment is the current mutable segment (not already moved)
// and it is not frozen.
if (mutableSegment.IsFrozen || mutableSegment != MutableSegment)
return;

//Don't move empty segment zero.
//Don't move empty mutable segment.
var c = mutableSegment.Length;
if (c == 0)
return;
Expand Down
8 changes: 4 additions & 4 deletions src/ZoneTree/IZoneTreeMaintenance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Tenray.ZoneTree;
public interface IZoneTreeMaintenance<TKey, TValue>
{
/// <summary>
/// Gets current Segment Zero.
/// Segment Zero is the writable part of the LSM tree.
/// Gets current mutable segment.
/// Mutable segment is the only writable part of the LSM tree.
/// </summary>
IMutableSegment<TKey, TValue> MutableSegment { get; }

Expand Down Expand Up @@ -126,7 +126,7 @@ public interface IZoneTreeMaintenance<TKey, TValue>
void DestroyTree();

/// <summary>
/// Event is fired when segment zero is moved forward.
/// Event is fired when mutable segment is moved forward.
/// </summary>
event MutableSegmentMovedForward<TKey, TValue> OnMutableSegmentMovedForward;

Expand Down Expand Up @@ -192,7 +192,7 @@ public interface IZoneTreeMaintenance<TKey, TValue>
}

/// <summary>
/// Event is fired when segment zero is moved forward.
/// Event is fired when mutable segment is moved forward.
/// </summary>
/// <typeparam name="TKey">The key type</typeparam>
/// <typeparam name="TValue">The value type</typeparam>
Expand Down
14 changes: 7 additions & 7 deletions src/ZoneTree/Options/ZoneTreeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public class ZoneTreeOptions<TKey, TValue>
/// Mutable segment maximumum key-value pair count.
/// When the maximum count is reached
/// MoveMutableSegmentForward is called and current mutable segment is enqueued to
/// ReadOnlySegments layer.
/// the ReadOnlySegments layer.
/// </summary>
public int MutableSegmentMaxItemCount { get; set; } = 1_000_000;

/// <summary>
/// Disk segment maximumum key-value pair count.
/// When the maximum count is reached
/// The disk Segment is enqueued into to the bottom segment layer.
/// The disk segment is enqueued into to the bottom segments layer.
/// </summary>
public int DiskSegmentMaxItemCount { get; set; } = 20_000_000;

Expand Down Expand Up @@ -71,22 +71,22 @@ public class ZoneTreeOptions<TKey, TValue>
public MarkValueDeletedDelegate<TValue> MarkValueDeleted { get; set; } = (ref TValue x) => { x = default; };

/// <summary>
/// Write Ahead Log Options. The options is being used
/// for creation of new Write Ahead Logs.
/// Write Ahead Log Options. The options are used
/// to create new Write Ahead Logs.
/// Existing WALs is being created with their existing options.
/// </summary>
public WriteAheadLogOptions WriteAheadLogOptions { get; set; } = new();

/// <summary>
/// Disk Segment options. The options is being used
/// for creation of new disk segments.
/// Disk Segment options. The options are used
/// to create new disk segments.
/// Existing disk segments is being created with
/// their existing options.
/// </summary>
public DiskSegmentOptions DiskSegmentOptions { get; set; } = new();

/// <summary>
/// Controls lock granularity of in memory BTree that represents
/// Controls lock granularity of in-memory BTree that represents the
/// mutable segment.
/// </summary>
public BTreeLockMode BTreeLockMode { get; set; } = BTreeLockMode.NodeLevelMonitor;
Expand Down
6 changes: 3 additions & 3 deletions src/ZoneTree/docs/ZoneTree/README-NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Benchmark for all modes: [benchmark](https://raw.githubusercontent.com/koculu/Zo
| str-str ZoneTree sync-compressed WAL | 1752 ms | 3397 ms | 5070 ms | 19153 ms |
| str-str ZoneTree sync WAL | 3488 ms | 7002 ms | 10483 ms | 38727 ms |
||
| RocksDb sync WAL | NOT SUPPORTED |
| RocksDb sync WAL (10K => 11 sec) | ~1.100.000 ms | N/A | N/A | N/A |
| int-int RocksDb sync-compressed WAL | 8059 ms | 16188 ms | 23599 ms | 61947 ms |
| str-str RocksDb sync-compressed WAL | 8215 ms | 16146 ms | 23760 ms | 72491 ms |
||
Expand All @@ -61,12 +61,12 @@ ThresholdForMergeOperationStart = 2_000_000;

Additional Notes:
According to our tests, ZoneTree is stable and fast even with big data.
Tested up to 200M records in desktop computers till now.
Tested up to 1 billion records in desktop computers till now.

### ZoneTree offers 4 WAL modes to let you make a flexible tradeoff.

* The sync mode provides maximum durability but slower write speed.
In case of a crash/power cut, the sync mode ensures that the inserted data is not lost. RocksDb does not have sync WAL mode. It has a WAL mode similar to the sync-compressed mode. ( reference: [rocksdb.org](http://rocksdb.org/blog/2017/08/25/flushwal.html) )
In case of a crash/power cut, the sync mode ensures that the inserted data is not lost.

* The sync-compressed mode provides faster write speed but less durability.
Compression requires chunks to be filled before appending them into the WAL file.
Expand Down
2 changes: 1 addition & 1 deletion src/ZoneTree/docs/ZoneTree/guide/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Benchmark for all modes: [benchmark](https://raw.githubusercontent.com/koculu/Zo
| str-str ZoneTree sync-compressed WAL | 1752 ms | 3397 ms | 5070 ms | 19153 ms |
| str-str ZoneTree sync WAL | 3488 ms | 7002 ms | 10483 ms | 38727 ms |
||
| RocksDb sync WAL | NOT SUPPORTED |
| RocksDb sync WAL (10K => 11 sec) | ~1.100.000 ms | N/A | N/A | N/A |
| int-int RocksDb sync-compressed WAL | 8059 ms | 16188 ms | 23599 ms | 61947 ms |
| str-str RocksDb sync-compressed WAL | 8215 ms | 16146 ms | 23760 ms | 72491 ms |
||
Expand Down
2 changes: 1 addition & 1 deletion src/ZoneTree/docs/ZoneTree/guide/write-ahead-log.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### ZoneTree offers 4 WAL modes to let you make a flexible tradeoff.

* The sync mode provides maximum durability but slower write speed.
In case of a crash/power cut, the sync mode ensures that the inserted data is not lost. RocksDb does not have sync WAL mode. It has a WAL mode similar to the sync-compressed mode. ( reference: [rocksdb.org](http://rocksdb.org/blog/2017/08/25/flushwal.html) )
In case of a crash/power cut, the sync mode ensures that the inserted data is not lost.

* The sync-compressed mode provides faster write speed but less durability.
Compression requires chunks to be filled before appending them into the WAL file.
Expand Down

0 comments on commit eaea453

Please sign in to comment.