快速关系数据库,用于简单使用Python [英] Fast relational Database for simple use with Python

查看:150
本文介绍了快速关系数据库,用于简单使用Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的链接剪贴程序,写在python3.3,我想使用一个数据库,我想要存储以下事情:




  • 大约100.000个网站,只有网址,时间戳和每个网站的列表有几个属性



数据库。通过googling我发现以下数据库可能适合我的目的:Postgresql,SQLite或Firebird。



我非常感兴趣的速度访问数据库和获得想要的信息。例如:对于网站x,属性y存在,如果是,则读取它。
写作的速度当然也很重要。



我的问题:不同数据库的速度有很大差异,小程序?
也许有人可以告诉哪个数据库符合我的要求,并且很容易用python处理。



thx alot

解决方案

数据库的大小和规模并不特别大,几乎可以在任何现有的数据库解决方案的范围内使用。



基本上,你要做的是在你的机器上安装数据库服务器,它将在一个给定的端口上。然后可以使用Python安装库来访问它。



例如,如果你想使用Postgresql,你会安装在你的机器上,它会连接到一些端口,如5000或5432端口。 / p>

但是如果你只是有你正在谈论的信息来存储和检索,你可能想用NoSQL解决方案,因为它很容易。



例如,您可以在您的服务器上安装mongodb ,然后安装 pymongo < a>。 pymongo的教程将教你几乎所有你需要的应用程序。


for my link scraping program, written in python3.3, i want to use a database where i want to store the following thing:

  • around 100.000 websites, just the url, a timestamp and for each website a list with several properties

I dont have any knowledge in databases so far. By googling i found the following database maybe fit my purposes: Postgresql, SQLite or Firebird.

Im very interested in the 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 for the different databases or does it not really matter for my small program? Maybe someone can tell which database fits my requirements and is easy to handle with python.

thx alot

解决方案

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.

这篇关于快速关系数据库,用于简单使用Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆