Help Needed: Setting Up a Simple Database

Question:
I’d like some help choosing a database to use for my python project. In the past, I’ve used ReplitDB, but I’ve found it rather unreliable and has a limit of 50mb. I’m looking for a database that is completely free, has reasonable storage, and is easy to control. Once I’ve chosen a database, I’d also like some help setting this database up in my Python project.

In Replit, you can use Replit DB and SQLite for free. Since Replit DB is not suitable for you, you can choose the second option.

What would be a basic setup of SQLite?

When I use a database locally on a computer, I use one option (it uses saving data to a file, but it is hardly safe to use it in Replit), but it is also possible not to save data (data stored in a variable will be saved after the replay is stopped). If you don’t want a database leak, you’ll have to use the second option. This is written in the Replit documentation: https://docs.replit.com/hosting/databases/sqlite-on-replit

@KAlexK I tried to set it up, but when I stop my project and the run it again the database doesn’t stick.

local sqlite is dependent on storage and also leakes database. Replit SQLite shows you how to connect.


my proposed solution: go get a https://neon.tech account and use that database with postgres client.

How much storage does neon.tech free plan provide?

1GB IIRC, with certain amount of active compute time (it’s a serverless db solution). However, you can also create up to 10 branches to have more than one database.

What about MongoDB? Is that free too?

mongodb is another type of database. most hosting providers that i have found so far aren’t free.
Database protocols are open source (free by design), but it costs to host it.

I like to create a Json file to use as a database, and have the code write itself when an event happens.

This is useful, but inefficient, and wouldn’t work in real-world scenarios, unless that JSON file is stored in a database, but that d3eats the purpose.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.