<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>zzzeek - Latest Comments</title><link xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://disqus.com/sup/all.sup#forumcomments-d529a162" type="application/json"/><link>http://zzzeek.disqus.com/</link><description></description><atom:link href="http://zzzeek.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 09 May 2013 01:59:28 -0000</lastBuildDate><item><title>Re: zzzeek : Using Beaker for Caching? Why You'll Want to Switch to dogpile.cache</title><link>http://techspot.zzzeek.org/2012/04/19/using-beaker-for-caching-why-you-ll-want-to-switch-to-dogpile.cache#comment-890464029</link><description>&lt;p&gt;we use dogpile and memcache as cachebackend, it seems everything is ok,but sometimes when the memcache  broken,dogpile report connection error, in production the app will stop runing, how could we deal with it? , catch the excepion?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bright Wang</dc:creator><pubDate>Thu, 09 May 2013 01:59:28 -0000</pubDate></item><item><title>Re: zzzeek : Django-style Database Routers in SQLAlchemy</title><link>http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy#comment-868071236</link><description>&lt;p&gt;Thanks for the example.&lt;/p&gt;

&lt;p&gt;When using the RoutingSession I encountered a stumbling block, i.e. my program sent write/delete operations to a database slave - ouch.&lt;/p&gt;

&lt;p&gt;After debugging/single-stepping it became clear to me that for the idiom query.delete() or query.update() I always have to use session.using_bind("master") explicitly.&lt;/p&gt;

&lt;p&gt;Reason: Query.delete() and .update() might call session._autoflush(), but after that _flushing is reset to False, and then session.execute calls session.get_bind while _flushing is False.&lt;/p&gt;

&lt;p&gt;Maybe me stumbling over this might deserve a little cautionary remark in &lt;a href="http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#custom-vertical-partitioning" rel="nofollow"&gt;http://docs.sqlalchemy.org/en/...&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks again.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris</dc:creator><pubDate>Fri, 19 Apr 2013 06:22:46 -0000</pubDate></item><item><title>Re: zzzeek : Using Beaker for Caching? Why You'll Want to Switch to dogpile.cache</title><link>http://techspot.zzzeek.org/2012/04/19/using-beaker-for-caching-why-you-ll-want-to-switch-to-dogpile.cache#comment-841859816</link><description>&lt;p&gt;dogpile works as a key/value store, so when the value for a particular key is invalidated, it's gone.    invalidation is also "soft" based on expiration time, so there's no way an active "event" can be generated unless the backend supports such an event, or some kind of worker thread is scanning the whole cache all the time detecting values that have timed out.&lt;/p&gt;

&lt;p&gt; It seems like you're referring to the idea of storing multiple copies of an item in a cache, that is, when you have a series of query results individually stored in the cache, as well as potentially a single copy of an object that is also in those query results.   if you want cross-referencing cache invalidations like that, there's two general strategies - one is to tailor the query caching such that the results are cached only as a collection of other cache keys - this will add performance overhead as retrieving a cached query also means you need to retrieve each of the referenced objects.  The other is to somehow relate a series of cached queries together, and potentially associated with each individual key in the query as well.   There's many ways to approach that, and it depends on specifics.  Such as, if I wanted to cache the result of "SELECT * FROM table" as well as have cache records for each individual row, I might keep track of each row loaded from that query in an additional lookup table, so that when the "individual row" record is expired, a search is performed in the cache for all queries that also referred to that row so they can also be expired.&lt;/p&gt;

&lt;p&gt;These are very complex scenarios and I'm pretty skeptical that a Django plugin can provide a foolproof and performant out-of-the-box solution - IMHO, this is the kind of thing you really need to understand and implement fully, relying on a 3rd party system to "magically" do it will almost immediately lead to failure cases that can't be explained without fully understanding the whole system's inner workings.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Mon, 25 Mar 2013 13:44:14 -0000</pubDate></item><item><title>Re: zzzeek : Using Beaker for Caching? Why You'll Want to Switch to dogpile.cache</title><link>http://techspot.zzzeek.org/2012/04/19/using-beaker-for-caching-why-you-ll-want-to-switch-to-dogpile.cache#comment-841850043</link><description>&lt;p&gt;It sounds like dogpile doesn't do automatic invalidation (e.g. when an object is updated, invalidate all query results that include that object).  Is that correct?  Are there plans to add that support?  Or any tips on how to approach it?&lt;/p&gt;

&lt;p&gt;Related discussion:&lt;br&gt;&lt;a href="https://groups.google.com/forum/?fromgroups=#!topic/sqlalchemy/Tx2IdqEABAE" rel="nofollow"&gt;https://groups.google.com/foru...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like Django has a Cache Machine layer that supports automatic invalidation:&lt;br&gt;&lt;a href="http://jbalogh.me/2010/02/09/cache-machine/" rel="nofollow"&gt;http://jbalogh.me/2010/02/09/c...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Shahaf Abileah</dc:creator><pubDate>Mon, 25 Mar 2013 13:33:05 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-821203922</link><description>&lt;p&gt;Could the nested cursor and/or nestedload() concepts be applied to plain PostgreSQL using arrays? Example:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class="sql"&gt;&lt;br&gt;SELECT&lt;br&gt;  &lt;a href="http://customer.id" rel="nofollow"&gt;customer.id&lt;/a&gt; AS customer_id,&lt;br&gt;  &lt;a href="http://customer.name" rel="nofollow"&gt;customer.name&lt;/a&gt; AS customer_name,&lt;br&gt;  ARRAY(&lt;br&gt;    SELECT (&lt;br&gt;      "order".id,&lt;br&gt;      "order".customer_id,&lt;br&gt;      "order".order_info,&lt;br&gt;      ARRAY(SELECT item FROM item WHERE "order".id = item.order_id)&lt;br&gt;    )&lt;br&gt;    FROM "order"&lt;br&gt;    WHERE &lt;a href="http://customer.id" rel="nofollow"&gt;customer.id&lt;/a&gt; = "order".customer_id&lt;br&gt;  ) AS anon_1&lt;br&gt;FROM customer&lt;br&gt;WHERE &lt;a href="http://customer.id" rel="nofollow"&gt;customer.id&lt;/a&gt; = %(id_1)s&lt;br&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;This could save row processing time and avoid the row explosion associated with multiple joinedloads.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">avoidscorn</dc:creator><pubDate>Wed, 06 Mar 2013 13:08:20 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-759544398</link><description>&lt;p&gt;Good point about the ORM and migration making it easier to change later.  I will need to reverse the lookup -- it's a temporal triplestore / eav I'll be implementing.  I'll see how far the normalized approach gets me.  Thanks, Mike!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kevin</dc:creator><pubDate>Mon, 07 Jan 2013 20:33:32 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-759309133</link><description>&lt;p&gt;90% of the time I use the table-per-association approach, which has just one join, and it joins on simple integer indexed columns without an awkward string lookup thrown in.    Because we're using ORMs and migration tools, the fact that you end up creating more tables doesn't impact development complexity at all.&lt;/p&gt;

&lt;p&gt; I really never need to look up a polymorphic association in reverse (that is, all the objects that refer to Address), and I rarely want all the "associations" across many different kinds of objects to all be aggregated in one huge table.  So really, the things that the AR pattern offers even functionally I either don't need or I can get in a much simpler and more efficient way. &lt;/p&gt;

&lt;p&gt;I think in relational databases, diverging dramatically from a normalized approach as the AR approach does is a consistency trap.   At the end of the day a normalized and consistency-enforceable design saves my bacon in such a vast majority of cases that I'm not just very interested in the "fake foreign key" pattern, even if it did solve some problem I actually couldn't solve more easily in other ways.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Mon, 07 Jan 2013 15:50:07 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-759196204</link><description>&lt;p&gt;Thank you very much for this and particularly the updated example!&lt;/p&gt;

&lt;p&gt;I was wondering if you could further elaborate on the design choice.  Yours is normalized, but AR eliminates extra joins.  Is it worth worrying about efficiency and minimizing space and joins at this point?  Do databases automatically denormalize / cache these cases?  If not, what would you do to optimize this later?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kevin</dc:creator><pubDate>Mon, 07 Jan 2013 13:52:03 -0000</pubDate></item><item><title>Re: zzzeek : Thoughts on Beaker</title><link>http://techspot.zzzeek.org/2011/10/01/thoughts-on-beaker#comment-740877494</link><description>&lt;p&gt;there's no plans for an encrypted cookie lib within the dogpile.* project.  I'd like Ben or someone to re-package Beaker's encrypted cookie as its own thing.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Mon, 17 Dec 2012 11:37:55 -0000</pubDate></item><item><title>Re: zzzeek : Thoughts on Beaker</title><link>http://techspot.zzzeek.org/2011/10/01/thoughts-on-beaker#comment-740872977</link><description>&lt;p&gt;We use the beaker cookie session facility (in development mode so far) and wondered if there was a status for the new dogpile.* library for encrypted cookie sessions?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dbv</dc:creator><pubDate>Mon, 17 Dec 2012 11:32:13 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-693083041</link><description>&lt;p&gt;Sounds good. Let me know if you have any further questions or if something is not answered by the page I linked to.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Padraig O'Sullivan</dc:creator><pubDate>Fri, 26 Oct 2012 11:51:35 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-693076086</link><description>&lt;p&gt;Yes, that's what I was referring to. Your reply wasn't here when I came to respond to Mike.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jmafc</dc:creator><pubDate>Fri, 26 Oct 2012 11:43:52 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-693072331</link><description>&lt;p&gt;No, it's not Oracle GROUPING. It's an Oracle  CLUSTER. From the docs: "Clusters are groups of one or more tables physically stored together because they share common columns and are often used together. Because related rows are physically stored &lt;br&gt;together, disk access time improves."  So it allows you to store Customers together with their Orders, but as stated, it's strictly physical. You still get a relational model view of the data (well, SQL "relational").&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jmafc</dc:creator><pubDate>Fri, 26 Oct 2012 11:40:29 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-693065757</link><description>&lt;p&gt;I believe you are referring to table clusters in Oracle (&lt;a href="http://docs.oracle.com/cd/E11882_01/server.112/e25789/tablecls.htm#i25478)" rel="nofollow"&gt;http://docs.oracle.com/cd/E118...&lt;/a&gt;. We have a page on our support portal that compares this feature with Akiban's table grouping - &lt;a href="http://support.akiban.com/entries/20779441-how-does-table-grouping-compare-to-oracle-cluster-tables" rel="nofollow"&gt;http://support.akiban.com/entr...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Padraig O'Sullivan</dc:creator><pubDate>Fri, 26 Oct 2012 11:33:58 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-693044616</link><description>&lt;p&gt;Thank you for your interest in SlashDB (/db), Simon. /db is often a part of client's SaaS product (cloud installation), used as a gateway to enterprise databases (DMZ) or to realize benefits of Resource Oriented Architecture in data integration (behind firewall).&lt;/p&gt;

&lt;p&gt;The new version 0.6b is coming out as I write this. /db is available directly from VT Enterprise as an AMI virtual machine for Amazon EC2 or as a VMWare image or can be installed client's hardware. Currently we help our clients with installation and configuration. We are also planning a self-service version of the product to be generally available on AWS Marketplace by year end.&lt;/p&gt;

&lt;p&gt;Since you have already registered for a demo on our website we will be in touch with you shortly.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">agilevic</dc:creator><pubDate>Fri, 26 Oct 2012 11:12:32 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-693009207</link><description>&lt;p&gt;there's a good article on Oracle's GROUPING and related over here: &lt;a href="http://www.oracle-base.com/articles/misc/rollup-cube-grouping-functions-and-grouping-sets.php" rel="nofollow"&gt;http://www.oracle-base.com/art...&lt;/a&gt; .    I've never taken the time to understand how these operations work.   Not sure if you're referring to another feature that actually changes the on-disk storage ...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Fri, 26 Oct 2012 10:38:01 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-692941278</link><description>&lt;p&gt;I seem to recall that Oracle had that kind of "GROUPING" hierarchical storage capability, somewhat like Postgres' CLUSTER, but possibly combining tables like you describe.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jmafc</dc:creator><pubDate>Fri, 26 Oct 2012 09:30:14 -0000</pubDate></item><item><title>Re: zzzeek : Supporting a (Very Interesting) New Database</title><link>http://techspot.zzzeek.org/2012/10/25/supporting-a-very-interesting-new-database#comment-692564397</link><description>&lt;p&gt;SlashDB looks interesting, is it released yet? I can't see any information on how to get a hold of it...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Simon Wittber</dc:creator><pubDate>Thu, 25 Oct 2012 22:21:25 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-662116164</link><description>&lt;p&gt;OK, well I can't run that to see the specific issue but in general association_proxy has a "creator" argument that allows you to set up what it does when the target collection or attribute doesn't exist: &lt;a href="http://docs.sqlalchemy.org/en/rel_0_7/orm/extensions/associationproxy.html#creation-of-new-values" rel="nofollow"&gt;http://docs.sqlalchemy.org/en/...&lt;/a&gt;  hopefully that's where the solution to your issue would be&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Tue, 25 Sep 2012 10:58:13 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-661861757</link><description>&lt;p&gt;Sorry about that. Won’t be using hastebin again :s&lt;/p&gt;

&lt;p&gt;&lt;a href="http://dpaste.de/nVvuC/" rel="nofollow"&gt;http://dpaste.de/nVvuC/&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jökull Sólberg Auðunsson</dc:creator><pubDate>Tue, 25 Sep 2012 05:03:42 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-661477198</link><description>&lt;p&gt;it was down earlier, and now there's nothing there.  can you use a more common pastebin...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Mon, 24 Sep 2012 20:01:41 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-661026032</link><description>&lt;p&gt;Here is a snippet: &lt;a href="http://hastebin.com/vinexumevo.py" rel="nofollow"&gt;http://hastebin.com/vinexumevo...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am using the new declarative form as a base. Notice in line 67 where I am having to check if the association is set or not.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jökull Sólberg Auðunsson</dc:creator><pubDate>Mon, 24 Sep 2012 11:49:08 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-661017668</link><description>&lt;p&gt;which example are you using (not the really old ones here I hope) and can you post a full example please.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zzzeek</dc:creator><pubDate>Mon, 24 Sep 2012 11:38:56 -0000</pubDate></item><item><title>Re: zzzeek : Polymorphic Associations with SQLAlchemy</title><link>http://techspot.zzzeek.org/2007/05/29/polymorphic-associations-with-sqlalchemy#comment-660872524</link><description>&lt;p&gt;Love this pattern. Using it for an event stream, where different models can be subscribed to news items. I have one question: Since `assoc_id` is nullable the accessor raises an error when trying to append the first item through the association proxy and the association one-to-one hasn’t been set.&lt;/p&gt;

&lt;p&gt;Here is the relevant traceback&lt;br&gt;&lt;code&gt;&lt;br&gt;File "/Users/gydaloa/Envs/wodboard/lib/python2.7/site-packages/sqlalchemy/ext/&lt;a href="http://associationproxy.py" rel="nofollow"&gt;associationproxy.py&lt;/a&gt;", line 229, in __get__&lt;br&gt;  return self._scalar_get(getattr(obj, self.target_collection))&lt;br&gt;AttributeError: 'NoneType' object has no attribute 'events'&lt;br&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Is there an elegant way to set this automatically?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jökull Sólberg Auðunsson</dc:creator><pubDate>Mon, 24 Sep 2012 08:46:17 -0000</pubDate></item><item><title>Re: zzzeek : Server Side Templates and API Centric Development</title><link>http://techspot.zzzeek.org/2012/06/18/server-side-templates-and-api-centric-development#comment-659961920</link><description>&lt;p&gt;Partial templates rendering are now part of Pyramid 1.4 as package:path/to/template#defname.mako&lt;/p&gt;

&lt;p&gt;Thanks for the write up and suggestion.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">blaflamme</dc:creator><pubDate>Sun, 23 Sep 2012 11:10:39 -0000</pubDate></item></channel></rss>