r/AskProgramming • u/Known-Flamingo-209 • Aug 03 '26
HTML/CSS HTML DB/ Security
I’m a beginner in html, what database would you recommend me to use for a project that I want to be working initially on one device only, it would be for a friend to make a task easier at their job it’s my first real world project and I’m afraid that data will be lost
What security/ protection layers I must apply ?
What’s your recommendations
1
Upvotes
14
u/soundman32 Aug 03 '26
Personally, I would not do a project for someones job without their company paying you for it. Not just because its commercial, but because your friend probably shouldn't be allowing someone external, access to things internal to the business. For all the reasons you mention (security, gdpr, auditing). You dont know what you are doing, and your friend doesn't realise how easily they could lose their job because of it. By all means write the code and make it work, but for gods sake, dont let your friend actually use it at work.
6
u/JeLuF Aug 03 '26
HTML will not allow you to build anything like this. You'll need a real programming language, not only a markup language.
There are multiple ways to design such an application. The big question is where to place the business logic.
- Classical client/server architecture
The business logic ("the program") runs on a webserver and is implemented in Python, Java, JavaScript, PHP, ...
Using this model, basically any database can be used, as long as there is an API supported by the programming language used for the project.
The browser sends requests to the server, the server contacts the DB, processes the data and sends it back to the client.
- Database centric architecture
The business logic runs mostly in the web browser, using languages like JavaScript, TypeScript, or (very rarely) other languages compiled to WASM. The browser directly communicates with the database. The database layer will usually provide the authentication and authorization functionality.
In a database centric architecture, the browser has a direct database connection, so the user could in general bypass the business logic and trigger malicious database changes. To prevent this, it's important to properly manage access rights in the database.
Firebase and Supabase are prominent products supporting such kinds of archirtecture.
To decide which of these approaches to choose, you need to identify the criticality of the data, whether it could be hosted in the cloud, which use cases the system should cover, which roles use the application. You also should think about how to back up the data. This is an important architecture question as well and not something to add last minute.
4
u/JGhostThing Aug 03 '26
I will warn you that proper authentication and authorization is very difficult. And getting it wrong with your friend's employer could cause a lot of problems. Getting it right could cause even more problems, because you'd need to know a lot of information, probably something the company would consider private.
If your friend needs this for work, he employer should pay for it.
2
u/DigitalJedi850 Aug 05 '26
The real question is ... why are you worried the data will be lost? What are you protecting it against?
Hardware failure? You need regular backups.
User deletion? Don't give your buddy direct access to the DB.
Your buddy's workplace deleting the data? Don't put your software on your buddy's work's computer...
Data doesn't just delete itself... Typically...