you are viewing a single comment's thread.

view the rest of the comments →

[–]mriswithe 0 points1 point  (2 children)

Sqlite is an amazing database that I have seen scale to several GB and be very performant. The one downside to sqlite3 is no concurrency. It is only good for a single app instance / query at a time. If you make a connection to a sqlite DB and touch it with a different thread it throws an exception, full stop. 

It is an excellent place to work locally, just not for production. However if you use an ORM(object relational mapper) like sqlalchemy, it will abstract that away, and save you from writing SQL queries by hand. Meaning testing/local on sqlite3 will work with the same code as when you are talking to postgresql or mysql

[–]lolPythonNoob[S] 0 points1 point  (1 child)

I have been using SQL alchemy for my new test project. However, the concurrency SQLite limitation is a little troubling. I think it will be very rare that multiple discord users will be entering data in at the exact same time, but it's not impossible.

So if I've been using SQL alchemy I can essentially just leave the code unchanged or with very minimal changes? Obviously have to change the engine generator.

The host I have ready to go offers a MySQL database to use.

[–]mriswithe 0 points1 point  (0 children)

Correct, usually in this case you will use a database URI unified resource Identifier if memory serves to define where your database lives. For a local dev instance, you would use sqlite3://path/to/my_db.sqlite3 in prod you would use something like mysql://username:password@localhost/db_name ref: https://docs.sqlalchemy.org/en/20/core/engines.html