What are the vulnerabilities of utilizing file systems instead of SQLite?


#1

I have a domain address and host
I don’t want to have a site and I just want to have a server to put some data there

There are
1 - public-html folder where the index of a site could be placed in
2 - non public-html folder where the important files from security point of view are placed in

I put the data in non public-html
In public-html, I just put a php file called file1 which includes another php file called file2 which is placed in non public-html
file2 is responsible for uploads of the data to the non public-html and also some images and json files in public-html folder
But I don’t want to have any index file that a site needs

Regarding security issues on server, what are the vulnerabilities of utilizing this type of file system instead of SQLite?
Do I use SQLite or I use encrypted json files in non public-html place of the server?
In other words, can I forget SQlite and use this type of file system management or it is dangerous or unsafe compared to SQLite for any reason ?

Example:
Imagine I want to register username and passwords of some users
User name is phone number of the user
I can create the following folders to register or retrieve the username and password of the users quickly:
1 - folder of international code
2 - folder of the first 3 digit
3 - folder of the next 2 digit
4 - the json file which the phone number is registered there

for example if the phone number is +518203040, we have the following folders:
1 - 51
2 - 820
3 - 30
4 - file1.json which the phone number is registered in

for encryption I totally make a different and vague json file which is not readable except that you have the key for decryption

Thanks in advance


#2

Why not use a database? I am a bit confused. You can encrypt databases as well.


#3

1 - I’m newbie to database and afraid of attacks like database injection, …
2 - I’d like not to pay more time mastering database subjects too
3 - I don’t like dependency to hosting where they say you can buy this host then you can have 1 database or that host with 3 database
4 - I have to install something on the server