#What is the Best Database for a Small Node.js Project?
1 messages · Page 1 of 1 (latest)
how much load it can take?
how portable they are ?
No as much as Sqlite
scalable secure database.
MySQL/MariaDB or PostgreSQL
Small and portable
Sqlite
which one is better for data encryption?
i would like one portable as the sqlite
but i need some security
i was planning to use a aes 256 key for the server
Sqlite should be fine.
sqlite don't have user and password like mysql
it only can be accessed on the current machine?
like the file system?
The reason why it doesn't have a user and password like mysql or postgresql is because it is not a server. Sqlite is a file base sql database.
It would be great if you could tell us all your requirements or better, you should google those three options and see the one that fit the most your requirements
i had googled they all
and then i got myself thinking about sqlite or mysql or postgresql
my project is pretty small
and i wanted to have a database because it would make me learn how to use it
i don't have much storage and the sqlite fit's better the requeriments
thanks for the help
MariaDB / MySQL is easier for AES256
you can do Salt and Pepper AES-256 key hashing with them easily also and KDF on top.
aes_encrypt() / aes_decrypt()
AES_DECRYPT(crypt_str,key_str[,init_vector][,kdf_name][,salt][,info | iterations])
This function decrypts data using the official AES (Advanced Encryption Standard) algorithm. For more information, see the description of AES_ENCRYPT().
Statements that use AES_DECRYPT() are unsafe for statement-based replication.
AES_ENCRYPT(str,key_str[,init_vector][,kdf_name][,salt][,info | iterations])
AES_ENCRYPT() and AES_DECRYPT() implement encryption and decryption of data using the official AES (Advanced Encryption Standard) algorithm, previously known as “Rijndael.” The AES standard permits various key lengths. By default these functions implement AES with a 128-bit key length. Key lengths of 196 or 256 bits can be used, as described later. The key length is a trade off between performance and security.
AES_ENCRYPT() encrypts the string str using the key string key_str, and returns a binary string containing the encrypted output. AES_DECRYPT() decrypts the encrypted string crypt_str using the key string key_str, and returns the original plaintext string. If either function argument is NULL, the function returns NULL. If AES_DECRYPT() detects invalid data or incorrect padding, it returns NULL. However, it is possible for AES_DECRYPT() to return a non-NULL value (possibly garbage) if the input data or the key is invalid.
As of MySQL 5.7.40, these functions support the use of a key derivation function (KDF) to create a cryptographically strong secret key from the information passed in key_str. The derived key is used to encrypt and decrypt the data, and it remains in the MySQL Server instance and is not accessible to users. Using a KDF is highly recommended, as it provides better security than specifying your own premade key or deriving it by a simpler method as you use the function. The functions support HKDF (available from OpenSSL 1.1.0), for which you can specify an optional salt and context-specific information to include in the keying material, and PBKDF2 (available from OpenSSL 1.0.2), for which you can specify an optional salt and set the number of iterations used to produce the key.
Well it's not scalable but using json for simple one table is fine
i do that for super low and small projects
thanks for the explanation
Define not scalable ?
We have 10M views with 300M rows per month in JSON mysql client_info sharded table on a single master-master MySQL 8.0 setup.
The TSV import in Java to SQL to MySQL takes 15 minutes clocked.
i think he mean literally using json files
Ya
For a read-only database, sure, I did that once... for a static website (no back-end)
For read-write... I dunno man.
read write still can be done
must you can't have much traffic
or at least the file can't be that big
so you can just keep it in memory
and sometimes save it
It's dumb but it works sometimes
Append database file log works fine with high traffic, but then you need to merge all files in the back-end by hand.