<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: asynchronous</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/asynchronous.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2024-11-24T17:47:27+00:00</updated><author><name>Simon Willison</name></author><entry><title>Is async Django ready for prime time?</title><link href="https://simonwillison.net/2024/Nov/24/async-django/#atom-tag" rel="alternate"/><published>2024-11-24T17:47:27+00:00</published><updated>2024-11-24T17:47:27+00:00</updated><id>https://simonwillison.net/2024/Nov/24/async-django/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://jonathanadly.com/is-async-django-ready-for-prime-time"&gt;Is async Django ready for prime time?&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Jonathan Adly reports on his experience using Django to build &lt;a href="https://colivara.com/"&gt;ColiVara&lt;/a&gt;, a hosted RAG API that uses &lt;a href="https://huggingface.co/vidore/colqwen2-v1.0"&gt;ColQwen2&lt;/a&gt; visual embeddings, inspired by the &lt;a href="https://arxiv.org/abs/2407.01449"&gt;ColPali&lt;/a&gt; paper.&lt;/p&gt;
&lt;p&gt;In a breach of &lt;a href="https://en.wikipedia.org/wiki/Betteridge%27s_law_of_headlines"&gt;Betteridge's law of headlines&lt;/a&gt; the answer to the question posed by this headline is “yes”.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We believe async Django is ready for production. In theory, there should be no performance loss when using async Django instead of FastAPI for the same tasks.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The ColiVara application is itself open source, and you can see how it makes use of Django’s relatively new &lt;a href="https://docs.djangoproject.com/en/5.1/topics/db/queries/#asynchronous-queries"&gt;asynchronous ORM features&lt;/a&gt; in the &lt;a href="https://github.com/tjmlabs/ColiVara/blob/main/web/api/views.py"&gt;api/views.py module&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I also picked up a useful trick &lt;a href="https://github.com/tjmlabs/ColiVarE/blob/0761a9f9f7ba582f56e49a48d9fdefedcfaa87a5/Dockerfile#L14"&gt;from their Dockerfile&lt;/a&gt;: if you want &lt;code&gt;uv&lt;/code&gt; in a container you can install it with this one-liner:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
&lt;/code&gt;&lt;/pre&gt;

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://news.ycombinator.com/item?id=42225088"&gt;Hacker News&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/asynchronous"&gt;asynchronous&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/embeddings"&gt;embeddings&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/rag"&gt;rag&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/uv"&gt;uv&lt;/a&gt;&lt;/p&gt;



</summary><category term="asynchronous"/><category term="django"/><category term="python"/><category term="embeddings"/><category term="rag"/><category term="uv"/></entry><entry><title>node.js at JSConf.eu (PDF)</title><link href="https://simonwillison.net/2009/Nov/17/nodepdf/#atom-tag" rel="alternate"/><published>2009-11-17T18:07:37+00:00</published><updated>2009-11-17T18:07:37+00:00</updated><id>https://simonwillison.net/2009/Nov/17/nodepdf/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://nodejs.org/jsconf.pdf"&gt;node.js at JSConf.eu (PDF)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
node.js creator Ryan Dahl’s presentation at this year’s JSConf.eu. The principle philosophy is that I/O in web applications should be asynchronous—for everything. No blocking for database calls, no blocking for filesystem access. JavaScript is a mainstream programming language with a culture of callback APIs (thanks to the DOM) and is hence ideally suited to building asynchronous frameworks.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/asynchronous"&gt;asynchronous&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/eventio"&gt;eventio&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/javascript"&gt;javascript&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nodejs"&gt;nodejs&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/pdf"&gt;pdf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ryan-dahl"&gt;ryan-dahl&lt;/a&gt;&lt;/p&gt;



</summary><category term="asynchronous"/><category term="eventio"/><category term="javascript"/><category term="nodejs"/><category term="pdf"/><category term="ryan-dahl"/></entry></feed>