Learn to Code via Tutorials on Repl.it!

← Back to all posts
Database tips
LiamDonohue (279)

#1 Backup weekly

Why? Because something might get corrupted, and you wont lose all your data because guess what? you were smart and backed up you data

#2 Store Your Database on a separate server

I know this may seem difficult, but its actually pretty easy. All you need is a computer running Windows 2000 or later (it actually runs better on an Linux computer, but i could not find any spec requirements for that) and an Apache 2.4 Server

#3 Call any tables containing sensitive data

something random, like Funkybannanasplit

#4 Use MySQL opposed to SQLite

Why? Because MySQL is more secure (EDIT) the reason is that MySQL is password protected and encrypted, making it harder to access. SQLite is basically just a file holding the data base and is stored on the disk, as MySQL is a server. So in someways SQLite is secure because its not really connected to the internet. SQLite is good for starting out, but MySQL is worth the setup

any suggestions? just tell me

CaptainAnon (116)

Autoescape user input before running it.

CaptainAnon (116)

What makes you think MySQL is more secure than SQLite?

LiamDonohue (279)

Both the SQLite and MYSQL have certain advantages. SQLite is file-based — the database consists of a single file on the disk, which makes it extremely portable and reliable. ... MySQL is secured, which makes it highly advanced, too. It can even handle a good amount of data and hence can be used at-scale.

CaptainAnon (116)

@LiamDonohue I don't think this should be a consideration when writing code for a service, providing you use an ORM. You can start by using SQLite and if that doesn't scale well enough for your needs (because your application becomes popular) you can switch to something like Postgres. I'd argue that being a single file on the disk (rather than a server) means that there is no database server to be hacked (because of poor user configuration, etc.)

RogueHalo (404)

Maybe use better formatting in your posts. E.g-Don't use Headers everywhere, Embolden more important parts of text etc...