I'd like to put forth my current thinking about asyncio.| charlesleifer.com
| charlesleifer.com
I'd like to share a simple trick I use to reduce roundtrips pulling data from a| charlesleifer.com
I'm pleased to announce that Peewee now supports CockroachDB| charlesleifer.com
With the release of Python 3.8 coming soon, the core development team has asked| charlesleifer.com
I recently wrote about Kyoto Tycoon (KT), a fast key/value database server. KT databases may be ordered (B-Tree / red-black tree) or unordered (hash table), and persistent or stored completely in-memory. Among other things, I'm using KT's hash database as a cache for things like HTML fragments, RSS feed data, etc. KT supports| charlesleifer.com
I saw an excellent article recently describing how to implement the fire effect seen in the trailer for the N64/PlayStation ports of the DooM game. I figured this would be neat to put on the page displayed whenever there's a server error. I already have an awesome 404 page, and now I'm equally happy with the 500 page.| charlesleifer.com
I've been interested in using Kyoto Tycoon| charlesleifer.com
In this post I'll present a short code snippet demonstrating how to use Redis| charlesleifer.com
Redis 5.0| charlesleifer.com
In this post I'll provide instructions for building a standalone Python sqlite3-compatible module which is powered by BerkeleyDB. This is possible because BerkeleyDB provides a SQL frontend, which essentially is the SQLite we all know and love with the b-tree code ripped out and replaced with BerkeleyDB.| charlesleifer.com
I began an unlikely adventure into Python packaging this week when I made what| charlesleifer.com
The upcoming SQLite 3.25.0 release adds support for one of my favorite SQL| charlesleifer.com
I recently open-sourced a Python library for| charlesleifer.com
On Monday of this week I merged in the 3.0a branch of peewee, a lightweight Python ORM, marking the| charlesleifer.com
The Python standard library sqlite3 driver| charlesleifer.com
The other day the idea occurred to me that it would be neat to write a simple| charlesleifer.com
Several months ago I was delighted to see significant progress on a relatively new extension in the SQLite| charlesleifer.com
Task queues are frequently deployed alongside websites to do background processing| charlesleifer.com
In this post I'd like to share with you some techniques for effectively working| charlesleifer.com
| charlesleifer.com
| charlesleifer.com
SQLite's write lock and pysqlite's clunky transaction state-machine are a toxic combination for multi-threaded applications. Unless you are very diligent about keeping your write transactions as short as possible, you can easily wind up with one thread accidentally holding a write transaction open for an unnecessarily long time. Threads that are waiting to write will then have a much greater likelihood of timing out while waiting for the lock, giving the illusion of poor performance.| charlesleifer.com
In this post I'll share a simple code snippet you can use to perform optimistic locking when updating model instances. I've intentionally avoided providing an implementation for this in peewee, because I don't believe it will be easy to find a one-size-fits-all approach to versioning and conflict resolution. I've updated the documentation to include the sample implementation provided here, however.| charlesleifer.com
For the past six months or so, I've been experimenting with a variety of monospace fonts in a quest to find the perfect coding font. While I haven't found a clear winner, I have found a dozen nice-looking fonts and learned a lot about typefaces in general. I've also learned quite a bit about font rendering on Linux, which I hope to summarize in a separate post soon.| charlesleifer.com
My desktop at the time of writing.| charlesleifer.com
When Kenneth Reitz created the requests library, the Python community rushed to embrace the project, as it provided (finally) a clean, sane API for making HTTP requests. He subtitled his project "Python HTTP Requests for Humans", referring to the fact that his API provided developer-friendly APIs. If naming things "for humans" had stopped there, that would have been fine with me, but instead there's been a steady stream of new projects describing themselves as being "For Humans" and I have is...| charlesleifer.com
Shortly after launching my Nginx-based cache + thumbnailing web-service, I realized I had no visibility into the performance of the service. I was curious what my hit-ratios were like, how much time was spent during a cache-miss, basic stuff like that. Nginx has monitoring tools, but it looks like they're only available to people who pay for Nginx Plus, so I decided to see if I could roll my own. In this post, I'll describe how I used Lua, cosockets, and Redis to extract real-time metrics fro...| charlesleifer.com
A month or two ago, I decided to remove Varnish from my site and replace it with Nginx's built-in caching system. I was already using Nginx to proxy to my Python sites, so getting rid of Varnish meant one less thing to fiddle with. I spent a few days reading up on how to configure Nginx's cache and overhauling the various config files for my Python sites (so much for saving time). In the course of my reading I bookmarked a number of interesting Nginx modules to return to, among them the Image...| charlesleifer.com
If you haven't heard, SQLite is an amazing database capable of doing real work in real production environments. In this post, I'll outline 5 reasons why I think you should use SQLite in 2016.| charlesleifer.com
AsyncIO| charlesleifer.com
AsyncIO| charlesleifer.com