Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering and sortDirection, either using @key (more involved) or @searchable (more expensive) #13

Open
mayteio opened this issue Mar 18, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mayteio
Copy link
Owner

mayteio commented Mar 18, 2020

All sorts of data access patterns are supported with DynamoDB given the right schema.

Problem is, it's not a generic solution to filtering which this package aims to provide. This is due to the way DynamoDB query works, underneath a listModel graphQL operation. If you provide a filter, and there are more than the default 10 items, you'll have to recursively paginate until you find something or reach the end of the table. This isn't how DynamoDB was designed.

Another solution would be to document and leverage ElasticSearch to allow easy generic searching. The DX for this would be much better. The cons would be introducing another service, potentially increasing usage costs and is just using a bandaid to fix something DynamoDB wasn't built to do.

I see two options here:

  1. Document use cases of filtering with @key directive. This will make filtering a case-by-case endeavour, putting more onus on the developer than the package to do this right.
  2. Encourage the use of @searchable directive for filtering models to avoid DynamoDB pain.
  3. Provide both options, letting the developer weigh up cost of service / easy DX.
@mayteio mayteio added the enhancement New feature or request label Mar 18, 2020
@CompleteScone
Copy link

This is something that another repo has done. Given the overlap of functionality, I wonder if it would be useful for you two to join forces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants