0

So I have two questions.

First, is it possible to record mp3 in an android app and how?

Second, is it possible to store this mp3 in a DynamoDB from the Android App and how?

M_B
  • 49
  • 7

2 Answers2

1

you can store binary data in DynamoDB yet there is a limit. Maximum size of item in DynamoDB is 400KB, which is not that much for an mp3.

You are also charged by WCU & RCU, every 4KB is single RCU and every 1KB to write is single WCU, or 2 WCUs if you write with transactional write.

Better save mp3 to S3 and save meta data to DynamoDB. You will be able to store any mp3 up to 5Tb in size. Will be able to utilize it's store classes to get the most cost-effective way to save that file too. DynamoDb is not great to store big files, it's best for high-velocity data because of it's infinity scale.

If you will end up uploading mp3 to S3, you should google around S3 presigned URLs too. That way you can keep your mp3 private and just get the private link for a short period of time so the user could download mp3 from s3 directly. Passing it through lambda will cost more $ and lambda also has it's file limits, won't be easy to pass through 100mb of mp3, which you may or may not have :)

Also to Upload the mp3 to S3 if you will be using lambda, you will be able to upload max 6Mb. While that's the limit of lambda's payload. Just use S3 presigned URLs to provide direct upload link from user to S3 bucket.

Lukas Liesis
  • 24,652
  • 10
  • 111
  • 109
0

Yes!

First you need to actually record the audio, use a library or refer to the Android docs to record it.

After that you will have a audio file that you need to upload to your database, I'm not personally a fan of uploading direct raw data into the database, I'm not a skilled dynamoDB but I don't think you can save blobs in a document.

I'd recommend to create an API, AWS has API Gateway and Lambdas you may use them to get the file uploaded from the Android device and store it on S3 and save the document reference to your DynamoDB

João Paulo Sena
  • 665
  • 4
  • 11
  • By using lambda max file upload size will be 6mb, check my response for more details https://stackoverflow.com/a/65758714/1737158 – Lukas Liesis Jan 17 '21 at 08:53