Fast relational database for simple use with Python [closed]

2024/10/15 9:23:14

For my link scraping program (written in python3.3) I want to use a database to store around 100.000 websites:

  • just the URL,
  • a time stamp
  • and for each website a list of several properties

I don't have knowledge about databases, but found the following may fit my purpose:

  • Postgresql
  • SQLite
  • Firebird

I'm interested in speed (to access the database and to get the wanted information). For example: for website x does property y exist and if yes read it. The speed of writing is of course also important.

My question: Are there big differences in speed or does it not matter for my small program? Maybe someone can tell which database fits my requirements (and is easy to handle with Python).

Answer

The size and scale of your database is not particularly large, and it's well within the scope of almost any off-the-shelf database solution.

Basically, what you're going to do is install the database server on your machine and it will come up on a given port. You then can install a library in Python to access it.

For example, if you want to use Postgresql, you'll install it on your machine and it will come up attached to some port like 5000, or port 5432.

But if you just have the information you're talking about to store and retrieve, you probably want to go with a NoSQL solution because it's very easy.

For example, you can install mongodb on your server, then install pymongo. The tutorial for pymongo will teach you pretty much everything you need for your application.

https://en.xdnf.cn/q/69301.html

Related Q&A

Event handling with Jython Swing

Im making a GUI by using Swing from Jython. Event handling seems to be particularly elegant from Jython, just setJButton("Push me", actionPerformed = nameOfFunctionToCall)However, trying same…

How Does Deque Work in Python

I am having trouble understanding how the deque works in the snippet of code below, while trying to recreate a queue and a stack in Python.Stack Example - Understoodstack = ["a", "b"…

When to use generator functions and when to use loops in Python

I am coming from a Matlab background and I am finding it difficult to get around the concept of generators in Python. Can someone please answer me the following:The difference between a generator funct…

Airflow - Disable heartbeat logs

My logs are getting completely flooded with useless messages for every heartbeat. [2019-11-27 21:32:47,890] {{logging_mixin.py:112}} INFO - [2019-11-27 21:32:47,889] {local_task_job.py:124} WARNING - T…

different validation in drf serializer per request method

Lets say i have a model like so:class MyModel(models.Model):first_field = models.CharField()second_field = models.CharField()and an API view like so:class MyModelDetailAPI(GenericAPIView):serializer_cl…

How to import r-packages in Python

Im a bit troubled with a simple thing. I was trying to install a package called hunspell, but I discovered it is originally an R package. I installed this version: https://anaconda.org/conda-forge/r-hu…

XPath predicate with sub-paths with lxml?

Im trying to understand and XPath that was sent to me for use with ACORD XML forms (common format in insurance). The XPath they sent me is (truncated for brevity):./PersApplicationInfo/InsuredOrPrinci…

Best way to access and close a postgres database using python dataset

import dataset from sqlalchemy.pool import NullPooldb = dataset.connect(path_database, engine_kwargs={poolclass: NullPool})table_f1 = db[name_table] # Do operations on table_f1db.commit() db.execut…

Using different binds in the same class in Flask-SQLAlchemy

I currently have multiple databases with identical Tables and Columns (but different data inside). So clearly I need to use binds to access all of them, but its apparently not as simple as doing this:c…

Correctly parse date string with timezone information

Im receiving a formatted date string like this via the pivotal tracker API: "2012/06/05 17:42:29 CEST"I want to convert this string to a UTC datetime object, it looks like python-dateutil doe…