Handling files on the production server [closed] - node.js

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 days ago.
Improve this question
I'm creating a website using MERN Stack the website will help people to create videos that create a voice over and subtitle on video.
The user would have to upload a video and write some text that would be sent to server and return for them the video they uploaded with subtitle and voice over of the content they have wrote.
so I have created a website that produce this functionality but what I got stuck with is how should I handle the files (videos uploaded, audio files, subtitles and final videos generated)
my current implementation handle everything on the production server as the client prefer that everything stay on the server (and he doesn't mind to through extra bucks for that)
the website is expected to handle between 1000-3000 request per day but I'm not sure with this load could a single server handle all of that? or should I get a server for handling the files and the other for my functionality?
I'm currently finishing my code to test this but I thought maybe someone here could help me to think about it differently or maybe I'm doing something naive and I should insist on using a third party service to handle the database and the files.

Related

I want to my web be able manipulate a file from my hard disk. What should I do? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am a beginner and I create a web app with react, I want to my web app be able to read and write a json or csv from my hard disk, I've done this easy with c++ and python I should learn about node.js, django or something like that? I've search and I don't know what to do
What should I do?
Edit: In this question I mean my disk no matter what, I readed the answers and already know what this is not a good idea
Part of the beauty of the web is that web browsers generally do not have access to the computer's filesystem. This is an intentional security choice. It would be horrible if advertisers could see the contents of your hard drive.
There are technologies that let individual websites store information on your computer that act a little bit like a filesystem, ranging from old school cookies to more advanced databases like LocalStorage or IndexedDB.

Separate server for video encoding? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm making a website that will handle video upload and encoding. My idea was to have the main server handle both client requests and video processing. But from my understanding, video encoding is cpu intensive. So I'm not sure if its a good idea to have one server do all the work, or have a separate server to do processing stuff. I want to try to future proof myself a bit in case I ever get high volumes of traffic, thus adding more processing work for the server.
So my question, is it overkill these days to have a separate server for video encoding, or am I going about this all wrong?
Ps. I'm using nodejs.
It will be overkill for someone starting out. As you mentioned, you don't have an idea of how much volume of traffic to expect yet, and it's difficult to project growth of your web app since it might grow gradually or take off immediately and hammer your server.
I would approach this in such a way where I can separate and queue the video processing work away from the main website. This will allow you to scale the video processing portion of your app without requiring you to run the entire website on there.
With a type of queuing system, you can also manage the amount of video you're processing at any point in time. So if 1 server can handle 5 video processing requests at once, any new request would have to wait until it finishes the previous request etc. Almost a micro-service type architecture.
Hope this gives you some ideas.

Where to store mp4 files on a node.js server? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am building some kind of video streaming web app using node.js/express and MongoDB. But I am facing an issue related to where to store the mp4 files that my clients will upload to my back-end. I am not sure if MongoDB is capable of storing large files(in the GB order) and my current idea is to keep the files on a directory and then keep track of each file path on MongoDB. Is this a good idea or is there a better method to do so?
My advice, use
s3.amazonaws.com
Yes, it's way better to store only a path inside a MongoDB instead of storing directly the video file inside the DB. Because your DB will grow up so fast if you did that. The disk space taken by both solutions is the same, but overloading your DB with these files will just result in a slower DB result

How do I create a dynamic web page for a client pulling from my database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a business idea where clients would enter some information in on a Software as a service type interface by filling out some web forms. The information they entered in would then be saved to my database. I am comfortable with this part, however I would like to be able to have clients put a small almost stupidly simple code snippet on their web page and be able to push content to their web page in a content div. I guess I could just send them a .php file to upload to their root and a single include line to write but I would prefer not to do this sort of thing since I don't really want to be mailing out proprietary code snippets with my DB information.
Are there any suggestions for how to implement the content push that are both extremely simple for clients to put on a web page but at the same time very private in the way the code is pushed?
I don't know if I understood your question really well but...
Isn't the answer to your problem a webservice? You could create a webservice that receives some sort of "password" and if the password is right you return the data JSON/XML formatted.
But you are talking about push, that means that when your server have new information you want to notify your client's server about the new information. I would say that what you should do in that case is make a request to the client server notifying them that you have "new stuff" and then after they have been notified they simply go ahead and use your webservice (mentioned above) and update their data.
I hope this answer your question or gives you and idea of how to do it.

user own image folders (security against hacker) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm creating a browser based image cloud service and every user will have his own picture folder.
My question is how to make sure, other users or hackers can not access foreign folders.
What is to consider?
Is it e.g. enough to check session-variables?
Thanks in advance!
I'm not 100% sure what you mean by just checking the session-variables.
I would create a setup like this:
\root
\userImages
\user1
\img1.png
\img2.png
\user2
\img1.png
\img2.png
\public
\index.php
I'm assuming you would use PHP or ASP.NET or something similar that uses some type of server like nginx or apahce. You can set the server root to the public folder. This means only your code would have access to the user images.
You can use PHP or whatever language to look at the session information and see if the user is authenticated. If you can, I would recommend encrypting the cookie data with Mycrypt. Once you have checked the authentication, you can get the file with a script and send back header information. Here's a really in depth article that I think would help you if you actually want a how-to. Protecting Images with PHP
If you are using PHP, Laravel handles sessions and protecing images really nicely.

Resources