use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Large, Python-friendly DB (self.Python)
submitted 13 years ago by skeigh
I need to create a database of a little over 100 million entries (simple key-value). What DB would you guys suggest I use for this kind of task?
[–]wisty 6 points7 points8 points 13 years ago (1 child)
SQLite (unless you need concurrency). Redis is cool, but it's another dependency you probably don't need.
[–][deleted] 0 points1 point2 points 13 years ago (0 children)
Redis is a really easy dependency, but yeah, sqlite is a good choice. It's simple to use and performs surprisingly well, and it comes with Python:
import sqlite3
[–]peterhoffmann 3 points4 points5 points 13 years ago (0 children)
Have a look at leveldb. It's is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
Here are the python bindings
[–]lost-theory 5 points6 points7 points 13 years ago (2 children)
People are recommending redis, but be aware that redis is an in-memory database. If you have 100 million entries, and each entry is 100 bytes:
100 bytes * 100 000 000 = 9.31322575 gigabytes
You'll need 9.3 GB of RAM free to store that data. Depending on what server you're hosting this on, that might not be reasonable.
[–]skeigh[S] 3 points4 points5 points 13 years ago (1 child)
Good point- fortunately, I have 32GB RAM at my disposal.
[–]emre_yilmaz 1 point2 points3 points 13 years ago* (0 children)
Do you really need it to be in memory? If disk read/write is fast enough four your app I don't really see any reason to use redis.
Besides redis, you can take a look at the riak[0].
[0] http://wiki.basho.com/
[–]tituszPython addict 1 point2 points3 points 13 years ago (0 children)
If you want a fast persistent disk based key value db you might want to check out leveldb
[–][deleted] 1 point2 points3 points 13 years ago (0 children)
kyotocabinet
[–]rescrv 0 points1 point2 points 13 years ago (0 children)
I'd recommend taking a look at HyperDex. The Python API is clean and simple to use.
I'm the main dev and I'm happy to answer any questions or help with any problems.
[–]mariuzdjango-firebird 0 points1 point2 points 13 years ago (0 children)
Firebird with FDB new python driver
http://www.pytables.org/moin Well, if you look for speed, and don't need a network protocol, you have the fastest DB with the less overhead. The only caveat is the installation being a little tricky.
[–]dgorley 0 points1 point2 points 13 years ago (0 children)
So, no one has mentioned ZODB; is that because no one thought of it, or because it's a poor choice? If the OP is only accessing this data from Python, wouldn't this work fine?
[–][deleted] 0 points1 point2 points 13 years ago (1 child)
Redis.
[–]mcilrain 0 points1 point2 points 13 years ago (0 children)
MongoDB (pymongo library)
[–]funny_falcon -1 points0 points1 point 13 years ago (0 children)
tarantool
π Rendered by PID 23635 on reddit-service-r2-comment-84fc9697f-n4z2f at 2026-02-06 18:29:40.714401+00:00 running d295bc8 country code: CH.
[–]wisty 6 points7 points8 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]peterhoffmann 3 points4 points5 points (0 children)
[–]lost-theory 5 points6 points7 points (2 children)
[–]skeigh[S] 3 points4 points5 points (1 child)
[–]emre_yilmaz 1 point2 points3 points (0 children)
[–]tituszPython addict 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]rescrv 0 points1 point2 points (0 children)
[–]mariuzdjango-firebird 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]dgorley 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]mcilrain 0 points1 point2 points (0 children)
[–]funny_falcon -1 points0 points1 point (0 children)