Report this

What is the reason for this report?

Creating udemy like video streaming platform

Posted on August 20, 2020

Hello DigitalOcean community!

I’m trying to create a Udemy or Coursera like website using DigitalOcean.

I already have a e-commerce type platform on my droplet which uses nodeJS + Angular + MySQL and it doesn’t have any media files.

My next project is likely to involve more than a droplet, and it seems like using Spaces is going to be needed since videos will take up so much space (no puns intended)

I’m just trying to understand the technology and workflow of this solution, and I have list of clarifications to make.

1) Connection between Frontend, Backend, and Spaces

a) I assume, my Frontend would be talking with NodeJS backend service which talks with the Spaces to stream the video.

b) Talking from my Frontend directly with the spaces seems like a bad idea for multiple reasons. 1) Authentication, some users have access to some videos 2) sending the video by section is pretty much impossible (I’m just guessing because backend service deals with sending by packets) Correct me if I’m misunderstanding and possibly this could be the right solution.

2) The outbound streaming limit

Spaces said to have a outbound limit of 1TB per month whereas my droplet has 4TB per month.

So by making my spaces the same location as my droplet, I can send outbound of 4TB data per month for free? (If using method [A] from above)

My understanding is the spaces sends 4TB to my droplet and my droplet can send those to the internet, and on the docs it says the internal transfer is free.

3) Streaming data between spaces and droplet

If i’m planning to send video data from backend to frontend by packets (meaning a few seconds worth of video at a time) can I these packet reading from spaces and send that to my frontend?

I’m assuming fetching the whole video from the backend and then sending it piece by piece to the frontend is a terrible idea.

All of your insights would be appreciated, and I’m in the middle of my research about the technology stack and feasibility.

Any other suggestions besides these would be helpful as well. 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.

Heya,

We do have resources on this topic which you can check here

https://www.digitalocean.com/solutions/streaming

https://www.digitalocean.com/resources/article/improve-performance-media-streaming

If you’re planning on using our Spaces product you can consider the following information.

Spaces are designed for storing and serving moderate to large files. Files 20 MB to 200 MB in size will give the best performance for both writes and reads. Additionally, combining small files into one larger file will greatly reduce the overall number of requests to your Space compared to handling many small files individually.

How Do I Implement This?

When uploading files larger than 500 MB, you should use multi-part uploads.

We recommend combining files less than 1 MB together into a single, larger file. How you do this will be specific to your particular files and use case, but one example is concatenating daily log files into a monthly file.

Hope that this helps!

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.