Report this

What is the reason for this report?

Is it advisable to access Space directly from mobile app?

Posted on April 1, 2021

Currently, we have note taking app for Android.

We would like to offer individual storage for users, so that they can store their notes, pictures, drawing, voice recordings, etc to cloud.

I am interested in Space offered by Digital Ocean.

However, I have some questions regarding the detailed implementation.

  1. Is it advisable to have mobile app to perform bucket creation, batch files uploading directly to Space? If we plan to have mobile app to perform direct batch files uploading to Space, does that mean we need to embed Space’s access key and secret key into mobile app?

  2. If it is not advisable to have Space’s access key and secret key embed into mobile app (Due to security concern), does that mean we need to have a web app running in droplet? Web app in droplet will responsible to perform authentication on mobile app’s request. Web app will be the sole contact point to talk to Space. That’s mean, mobile app needs to first send batch files to web app, only then web app will transfer the batch files to Space.

Do you have a sample, on how mobile app + Space architecture should look like?

Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In my opinion, it is not advisable to embed your Spaces access key and secret key directly into your mobile app due to security concerns. Instead, you should set up a backend server running on a DigitalOcean Droplet, which will handle authentication and communicate with Spaces on behalf of the mobile app.

Here’s a basic architecture to help you understand the setup:

  1. User interacts with your mobile app, making a request that involves uploading files to Spaces.

  2. The mobile app sends the files and request details to your backend server.

  3. Your backend server authenticates and validates the request, then uploads the files to DigitalOcean Spaces using the access key and secret key stored on the server.

In this architecture, your mobile app will never directly access DigitalOcean Spaces, ensuring better security.

While we do not have a specific example for mobile apps interacting with Spaces, we do have a guide on how to use DigitalOcean Spaces with various SDKs and programming languages that you could adapt for your mobile app’s backend server:

DigitalOcean Spaces SDK Examples

Good luck with your implementation! If you have any more questions, feel free to ask.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.