Does dynamodb have maximum size limitation on query input? - amazon-dynamodb

I know dynamodb query has limitation on maximum response data size is 1MB. But does it have limitation on the input filter parameter? I may need to send a filter expression has a long list of values, I wonder whether it works without limtation?

As per AWS documentation:
The maximum length of any expression string is 4 KB, which includes ProjectionExpression, ConditionExpression, UpdateExpression, and FilterExpression.
check more details here
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html#limits-expression-parameters
hope it answer your question.

Related

`find_one` equivalent in DynamoDB?

I am trying to limit the response of scan operator to just one in DynamoDB. I came across an option, LIMIT but, this doesn't really limit the matching results to one. Rather, it specifies the amount of data in MB to be processed before Dynamo could return any result.
So, basically, I was wondering, if there is any equivalent of MongoDB's find_one operation in DynamoDB? And if NO, then is there an alternative with which we can achieve it?

Maximum number of items in DocumentDb IN clause

I can't find mention anywhere in the documentation the maximum number of items supported by the IN keyword in DocumentDb.
I would make the assumption that there is a limit.
Can anyone point out in the documentation that is referenced?
DocumentDB has virtually eliminated all limits by raising them to a level we don’t foresee our users surpassing, thus they are no longer documented. In this case, 1000 arguments can be in an IN clause.
Currently the limit for AWS DocumentDB is 10K items (10,000) for $in operator:
OperationFailure
$in array size must not be greater than 10000

Riak: how are queries using secondary indices implemented?

Consider a query that uses secondary indices. Does this cause the node that received the query to send out a request to all other nodes? That is, does the use of secondary indices require communicating with all other nodes to find data that matches the index lookup?
The best source for information on how querying of secondary indexes works can be found here:
http://docs.basho.com/riak/latest/dev/advanced/2i/
I believe that the portion of the explanation that is relevant to your question is:
"When issuing a query, the system must read from a “covering” set of partitions and then merge the results. The system looks at how many replicas of data are stored—the N value or n_val—and determines the minimum number of partitions that it must examine (1 / n_val) to retrieve a full set of results, also taking into account any offline nodes."
Also note that: "For all 2i queries, the R parameter is set to 1," - http://docs.basho.com/riak/latest/dev/using/2i/#Querying

Get 'X' number of records on DynamoDB

I'm trying know if exist something similar to TOP in SQL on DynamoDB
I'm reading the documentation http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html
But I didn't find something similar.
Someones knows a way to do it?
Limit in Scan/Query is what you were looking for
Both ScanRequest and QueryRequest have a withLimit function for limiting the maximum number of items to evaluate for a request.
From the documentation:
The maximum number of items to evaluate (not necessarily the number of
matching items). If DynamoDB processes the number of items up to the
limit while processing the results, it stops the operation and returns
the matching values up to that point, and a key in LastEvaluatedKey to
apply in a subsequent operation, so that you can pick up where you
left off. Also, if the processed data set size exceeds 1 MB before
DynamoDB reaches this limit, it stops the operation and returns the
matching values up to the limit, and a key in LastEvaluatedKey to
apply in a subsequent operation to continue the operation. For more
information, see Query and Scan in the Amazon DynamoDB Developer
Guide.

Is a scan query always expensive in DynamoDB or should you use a range key

I've been playing around with Amazon DynamoDB and looking through their examples but I think I'm still slightly confused by the example. I've created the example data on a local dynamodb instance to get used to querying data etc. The sample data sets up 3 tables of 'Forum'->'Thread'->'Reply'
Now if I'm in a specific forum, the thread table has a ForumName key I can query against to return relevant threads, but would the very top level (displaying the forums) always have to be a scan operation?
From what I can gather the only way to "select *" in dynamodb is to use a scan and I assume in this instance - where forum is very high level and might have a relatively small number of rows - that it wouldn't be that expensive or are you actually better creating a hash and range key and using that to query this table? I'm not sure what the range key would be in this instance, maybe just a number and then specify in the query that the value has to be > 0? Or perhaps a date it was created and the query always uses a constant date in the past?
I did try a sample query on the 'Forum' table example data using a ComparisonOperator of 'GE' (Greater than or equal) with an attribute value list of 'S'=>'a' but this states that any conditions on the hash key must be of type EQ which implies I couldn't do the above as I would always need to know my 'Name' values upfront
Maybe I'm still struggling having come from an RDBS background especially seen as there are many forum examples out there.
thanks
I think using Scan to get all the forums is fine. I think it is very efficient because it will not return you anything that you don't need (all of the work that scan does is necessary). Also since Scan operation is so simple it is easier to implement and more likely to be efficient

Resources