#What is the Best Database for a Small Node.js Project?

1 messages · Page 1 of 1 (latest)

tulip wolf
#

I'm working on a nodejs project and now it's time to learn how to use a scalable secure database.
What i should try to learn?

hot tiger
#

Sqlite

#

?

tulip wolf
#

how much load it can take?

edgy spade
#

I'd recommend MySQL/MariaDB or PostgreSQL.

#

Easier/better to scale than Sqlite

tulip wolf
#

how portable they are ?

edgy spade
#

No as much as Sqlite

#

scalable secure database.
MySQL/MariaDB or PostgreSQL

Small and portable
Sqlite

tulip wolf
#

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

edgy spade
#

Sqlite should be fine.

tulip wolf
#

sqlite don't have user and password like mysql

#

it only can be accessed on the current machine?

#

like the file system?

edgy spade
#

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

tulip wolf
#

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

radiant scaffold
#

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.

tacit belfry
#

Well it's not scalable but using json for simple one table is fine

tulip wolf
tulip wolf
radiant scaffold
tulip wolf
tacit belfry
radiant scaffold
#

For read-write... I dunno man.

tulip wolf
#

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

radiant scaffold
#

Append database file log works fine with high traffic, but then you need to merge all files in the back-end by hand.