TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Pydb – a lightweight database with Python syntax queries, using ZeroMQ

130 pointsby asrpover 8 years ago

14 comments

goerzover 8 years ago
There&#x27;s already an (albeit deprecated) debugger package called pydb (<a href="http:&#x2F;&#x2F;bashdb.sourceforge.net&#x2F;pydb&#x2F;" rel="nofollow">http:&#x2F;&#x2F;bashdb.sourceforge.net&#x2F;pydb&#x2F;</a>). It would be good to choose a different name for this, most importantly because `pip install pydb` is already taken
评论 #13508595 未加载
评论 #13507911 未加载
jmdukeover 8 years ago
It might not hold up to heavy use cases, but I can already imagine a bunch of ways this would make my life easier (I use Python scripts to handle a bunch of social media stuff and basic analytics, for instance, where I use either text files or some other proxy to handle state.)<p>The only request I&#x27;d have is a syntactically saccharine way of spinning up the server within the client itself, which is in general an awful idea but would make my life easier for toy use cases.
评论 #13508016 未加载
ThePhysicistover 8 years ago
I wrote a similar library -BlitzDB- a while ago:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;adewes&#x2F;blitzdb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;adewes&#x2F;blitzdb</a><p>It&#x27;s a pure Python database engine with a MongoDB-like query engine and support for three different backends: File (native), SQL (via SQLAlchemy) and MongoDB.<p>The library transparently translates a large number of MongoDB queries into SQL or its own native storage backend, and when using the SQL backend it can do things that MongoDB can&#x27;t, like queries spanning multiple relationships.<p>The latest version is not fully documented yet but I&#x27;m using it on several production projects myself. I&#x27;m looking for a maintainer and contributors btw, so if you&#x27;re interested feel free to get in touch with me!
评论 #13509512 未加载
daenneyover 8 years ago
What&#x27;s the purpose&#x2F;gain of layering ZMQ into this? I read the architecture bit but I&#x27;m still unclear as to what benefit this brings. I guess it allows for multiple clients to use the database at the same time? I can see how the queueing thing is useful for writes if you don&#x27;t want to have to handle more than one at the same time for the sake of complexity, but wouldn&#x27;t doing this for reading slow things down unnecessarily?
评论 #13507982 未加载
jlpdyhover 8 years ago
You could use `-e git:&#x2F;&#x2F;github.com&#x2F;asrp&#x2F;undoable` in requirements.txt to save some steps.
评论 #13508184 未加载
emehrkayover 8 years ago
Will this code not cause issues? I know that you aren&#x27;t modifying args or kwargs, in the _run method, but it just seems like a potential point of failure or a python anti-pattern<p><pre><code> def _run(self, func=None, args=(), kwargs={})</code></pre>
评论 #13509460 未加载
nerdponxover 8 years ago
Why would I want to use this over SQLite?
vapemasterover 8 years ago
Seems like this could be a good idea for small personal or temporary dashboards. Especially those with viz powered by packages that work natively with Python data structures like bokeh or plotly .
MeteorMarcover 8 years ago
The syntax reminds me of PyDal: <a href="https:&#x2F;&#x2F;pypi.python.org&#x2F;pypi&#x2F;pyDAL" rel="nofollow">https:&#x2F;&#x2F;pypi.python.org&#x2F;pypi&#x2F;pyDAL</a> <a href="http:&#x2F;&#x2F;www.web2py.com&#x2F;books&#x2F;default&#x2F;chapter&#x2F;29&#x2F;06&#x2F;the-database-abstraction-layer#Shortcuts" rel="nofollow">http:&#x2F;&#x2F;www.web2py.com&#x2F;books&#x2F;default&#x2F;chapter&#x2F;29&#x2F;06&#x2F;the-databa...</a>
toumorokoshiover 8 years ago
vanilla zeromq is a pretty bad choice for any database. zmq explicitly makes no guarantees about reliable delivery, so losing random inserts or queries here or there would be considered acceptable.<p>subscribers also lose the first few messages the publisher sends, unless you make sure you start the subscriber first. The publisher will make no indication of which messages are lost and which ones have actually been sent to someone:<p><a href="http:&#x2F;&#x2F;zguide.zeromq.org&#x2F;page:all#Getting-the-Message-Out" rel="nofollow">http:&#x2F;&#x2F;zguide.zeromq.org&#x2F;page:all#Getting-the-Message-Out</a><p>I would suggest building something on top of request-reply instead: it&#x27;s actually possible to get build reliable delivery on that.<p><a href="http:&#x2F;&#x2F;zguide.zeromq.org&#x2F;page:all#reliable-request-reply" rel="nofollow">http:&#x2F;&#x2F;zguide.zeromq.org&#x2F;page:all#reliable-request-reply</a>
webmavenover 8 years ago
Rather reminds me of ZODB[0].<p>[0] <a href="http:&#x2F;&#x2F;www.zodb.org" rel="nofollow">http:&#x2F;&#x2F;www.zodb.org</a>
评论 #13507312 未加载
评论 #13507259 未加载
d0vsover 8 years ago
Looks like a better shelve <a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3.6&#x2F;library&#x2F;shelve.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3.6&#x2F;library&#x2F;shelve.html</a>
BerislavLopacover 8 years ago
Reminds me of TinyDB <a href="https:&#x2F;&#x2F;tinydb.readthedocs.io" rel="nofollow">https:&#x2F;&#x2F;tinydb.readthedocs.io</a>
gigatexalover 8 years ago
Hmm this is pretty interesting. Going to check this out.