Forums

Date storage and databases

Hi,

I'm making a very small scale app that will have less than 20 users and maybe 100 megabytes of data total stored on it. That app would involve basically uploading and downloading a bunch of compressed text files > than 1MB big (map files for a game).

I read the pythonanywhere flask tutorial and while it proved helpful, the part about database made my head ache. Do you think I could only rely on databases for stuff like storing passwords and just put the map files directly on disc to serve them staticly? I'm sure there is a bunch of issues with this, but privacy of said files and scalability almost don't matter in my case, and keeping things simple helps me to be motivated to get stuff done.

If you have a better idea please share.

Sure! Databases are at their best when they're used for storing large numbers of relatively structured items of data, like users or forum posts. If your site is essentially a way of serving large files, and you're not worried about people accessing the files even if they're not logged in, then static files are the best option.

BTW which bit of the database stuff was the most headache-inducing? I wrote the tutorial and it's always good to know which bits could be improved.

The uncompressed text to define a bit of terrain would be something like

hex1 . position [17.60206,0.00000,-50.81278]

hex1 . rotation [0,0,0]

hex1 . permissions 31

hex1 as small_hex_earth

hex1 local_to xform1

Your tutorial was definitely helpful, The secure password-protected account system was easy and painless to add and git sounds helpful.

The part that turned me off was the long setup needed for migrating. I'm kinda a control freak, I like the complexity of something to be either hidden enough that I don't pay attention to it or well understood. The manipulations necessary are not like changing a file, you can't just easily undo them if something goes wrong. This kind of thinking is why I find the idea of c more appealing than c++ , even though c++ is a superset of it (not that I'm good with either one)

Also, databases are an unfamiliar idea to me while manipulating textual map files is something I'm already used to. Using a fresh programming paradigm can kinda feel like jumping through hoops to do something you already know how in a more natural way.

Please don't assume my feedback to be representative of your average reader. I'm weird, I participated to extracurricular math contests then got confused by regular high school math classes. Algebra and musical notation hurt my brain.

Thanks.

Fair enough! Glad to hear you liked the other parts of the tutorial, anyway :-)

(And FWIW I totally agree about C vs C++ -- it's possible that some of the complexity in the description of migrations in the tutorial is there because I was trying to explain too much of how it works under the hood, because I don't like things that are complete black boxes...)

Oh, that's interesting.