You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-59Lines changed: 27 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,12 @@
1
1
# Dynamoid
2
2
3
-
You are viewing the README for version 3 of Dynamoid. See the [CHANGELOG](https://github.com/Dynamoid/Dynamoid/blob/master/CHANGELOG.md#200) for details on breaking changes since 1.3.x.
4
-
5
-
For version 1.3.x use the [1-3-stable branch](https://github.com/Dynamoid/Dynamoid/blob/1-3-stable/README.md).
| test coverage |[](https://coveralls.io/github/Dynamoid/Dynamoid?branch=master)|
But keep in mind Dynamoid -- and document-based storage systems in general -- are not drop-in replacements for existing relational databases. The above query does not efficiently perform a conditional join, but instead finds all the user's addresses and naively filters them in Ruby. For large associations this is a performance hit compared to relational database engines.
544
533
545
-
#### Pagination
546
-
##### Limits / Skip-Take
534
+
#### Limits
547
535
548
536
There are three types of limits that you can query with:
549
537
@@ -581,8 +569,9 @@ Address.record_limit(10_000).batch(100).each { … } # Batch specified as part o
581
569
The implication of batches is that the underlying requests are done in the batch sizes to make the request and responses
582
570
more manageable. Note that this batching is for `Query` and `Scans` and not `BatchGetItem` commands.
583
571
584
-
##### DynamoDB Native Pages
585
-
At times it can be useful to rely on DynamoDB [default pages](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.Pagination)
572
+
#### DynamoDB pagination
573
+
574
+
At times it can be useful to rely on DynamoDB [low-level pagination](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.Pagination)
586
575
instead of fixed pages sizes. Each page results in a single Query or Scan call
587
576
to DyanmoDB, but returns an unknown number of records.
588
577
@@ -591,18 +580,20 @@ method, which yields arrays of records.
591
580
592
581
```ruby
593
582
Address.find_by_pages do |addresses, metadata|
594
-
# have an array of pages
595
583
end
596
584
```
597
585
598
-
Each yielded pages returns metadata as the second argument, which is a hash
586
+
Each yielded pages returns page metadata as the second argument, which is a hash
599
587
including a key `:last_evaluated_key`. The value of this key can be used for
600
588
the `start` method to fetch the next page of records.
601
589
590
+
This way it can be used for instance to implement efficiently
@@ -727,44 +718,17 @@ There are following options:
727
718
728
719
The only mandatory option is `name`.
729
720
730
-
To use index in `Document.where` implicitly you need to project all the fields with option `projected_attributes: :all`.
731
-
732
-
There are two ways to query Global Secondary Indexes (GSI).
733
-
734
-
#### Explicit
735
-
736
-
The first way explicitly uses your GSI and utilizes the `find_all_by_secondary_index` method which will lookup a valid
737
-
GSI to use based on the inputs, you MUST provide the correct keys to match the GSI you want:
721
+
**WARNING:** In order to use global secondary index in `Document.where` implicitly you need to have all the attributes of the original table in the index and declare it with option `projected_attributes: :all`:
Most range searches, like `eq`, need a single value, and searches like `between`, need an array with two values.
731
+
There is only one implicit way to query Global and Local Secondary Indexes (GSI/LSI).
768
732
769
733
#### Implicit
770
734
@@ -820,6 +784,10 @@ Listed below are all configuration options.
820
784
`'t'` and `'f'`. Default is true
821
785
*`backoff` - is a hash: key is a backoff strategy (symbol), value is parameters for the strategy. Is used in batch operations. Default id `nil`
822
786
*`backoff_strategies`: is a hash and contains all available strategies. Default is { constant: ..., exponential: ...}
787
+
*`http_continue_timeout`: The number of seconds to wait for a 100-continue HTTP response before sending the request body. Default option value is `nil`. If not specified effected value is `1`
788
+
*`http_idle_timeout`: The number of seconds an HTTP connection is allowed to sit idble before it is considered stale. Default option value is `nil`. If not specified effected value is `5`
789
+
*`http_open_timeout`: The number of seconds to wait when opening a HTTP session. Default option value is `nil`. If not specified effected value is `15`
790
+
*`http_read_timeout`:The number of seconds to wait for HTTP response data. Default option value is `nil`. If not specified effected value is `60`
0 commit comments