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

kinesis sdk to upload batches concurrently #3467

Closed
dss99911 opened this issue Nov 14, 2023 · 2 comments
Closed

kinesis sdk to upload batches concurrently #3467

dss99911 opened this issue Nov 14, 2023 · 2 comments
Labels
kinesis video Issues with the AWS Android SDK for Kinesis Video. question General question

Comments

@dss99911
Copy link

dss99911 commented Nov 14, 2023

State your question
My Android application uploads records more than 3000 at one time and some users contain 80000 records.
and the business requirement is to upload these records as soon as possible.
but, when I check the kinesis recorder code

it seems to upload all the batch(128 records) sequentially.
for uploading 3000 ~ 80000 records, it takes 23 ~ 625 batch uploading sequentially.
so, I would like to ask if it's fine to upload the batches concurrently by thread or coroutine by customizing the code somehow by myself.
is it the proper approach? or I'll appreciate any suggestions. thanks

Which AWS Services are you utilizing?
aws-android-sdk-kinesis

Provide code snippets (if applicable)

Environment(please complete the following information):

  • SDK Version: 2.16.1

Device Information (please complete the following information):

  • Device: any
  • Android Version: any
  • Specific to simulators:

If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.

@dss99911 dss99911 changed the title kinesis sdk to upload records concurrently kinesis sdk to upload batches concurrently Nov 14, 2023
@tylerjroach
Copy link
Member

It looks like submitAllRecords is public and does not appear to use any private methods from what I can see. It looks like it may be relatively easy to override submitAllRecords in your code and modify the behavior to your use case.

From the documentation of PutRecords, it appears a reasonable first step may be to increase the batch size.

Each PutRecords request can support up to 500 records. Each record in the request can be as large as 1 MiB, up to a limit of 5 MiB for the entire request, including partition keys. Each shard can support writes up to 1,000 records per second, up to a maximum data write total of 1 MiB per second.

My concern with attempting to upload concurrent batches is that the ordering sequence may be lost.

@tylerjroach tylerjroach added kinesis video Issues with the AWS Android SDK for Kinesis Video. question General question labels Nov 14, 2023
@dss99911
Copy link
Author

Thanks for the answer.
As each shard can support writes up to 1,000 records per second,
we are considering converting multiple records to one for the first step.
after that, if it still needs faster uploading, I'll consider uploading concurrently as the data ordering is not important for the data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kinesis video Issues with the AWS Android SDK for Kinesis Video. question General question
Projects
None yet
Development

No branches or pull requests

2 participants