<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: stripe</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/stripe.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2024-07-02T04:46:44+00:00</updated><author><name>Simon Willison</name></author><entry><title>Weeknotes: a livestream, a surprise keynote and progress on Datasette Cloud billing</title><link href="https://simonwillison.net/2024/Jul/2/weeknotes/#atom-tag" rel="alternate"/><published>2024-07-02T04:46:44+00:00</published><updated>2024-07-02T04:46:44+00:00</updated><id>https://simonwillison.net/2024/Jul/2/weeknotes/#atom-tag</id><summary type="html">
    &lt;p&gt;My first YouTube livestream with Val Town, a keynote at the AI Engineer World's Fair and some work integrating Stripe with Datasette Cloud. Plus a bunch of upgrades to my blog.&lt;/p&gt;
&lt;h4 id="livestreaming-rag-with-steve-krouse-and-val-town"&gt;Livestreaming RAG with Steve Krouse and Val Town&lt;/h4&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2024/claude-rag/frame_011319.jpg" alt="Screnshot of a What is Datasette? page created by Claude 3.5 Sonnet - it includes a Key Features section with four different cards arranged in a grid, for Explore Data, Publish Data, API Access and Extensible." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;p&gt;A couple of weeks ago I broadcast a livestream with Val Town founder Steve Krouse, which I then &lt;a href="https://simonwillison.net/2024/Jun/21/search-based-rag/"&gt;turned into an annotated video write-up&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Outside of a few minutes in the occasional workshop I haven't ever participated in an extended live coding session before. Steve has been running &lt;a href="https://www.youtube.com/@ValDotTown/videos"&gt;a series of them&lt;/a&gt; where he live codes with different guests, and I was excited to be invited to join him.&lt;/p&gt;
&lt;p&gt;I really enjoyed it, and I think the end-result was very worthwhile. We built an implementation of RAG against my blog, demonstrating the RAG technique where you extract keywords from the user's question, search for them using a BM25 full-text search index (in this case SQLite FTS) and construct an answer using the search results.&lt;/p&gt;
&lt;p&gt;The more time I spend with this RAG pattern the more I like it. It's considerably easier to reason about than RAG using vector search based on &lt;a href="https://simonwillison.net/2023/Oct/23/embeddings/"&gt;embeddings&lt;/a&gt;, and can provide high quality results with a relatively simple implementation.&lt;/p&gt;
&lt;p&gt;It's often much easier to bake FTS on to an existing site than embedding search, since it avoids the need to run embedding models against thousands of documents and then create a vector search index to run the queries against.&lt;/p&gt;
&lt;p&gt;We also got to try out the launched-that-day Claude 3.5 Sonnet, which has quickly become my absolute favourite LLM.&lt;/p&gt;
&lt;p&gt;Full details (and video) in my write-up: &lt;a href="https://simonwillison.net/2024/Jun/21/search-based-rag/"&gt;Building search-based RAG using Claude, Datasette and Val Town&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="a-surprise-keynote"&gt;A surprise keynote&lt;/h4&gt;

&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2024/ai-worlds-fair/slide.001.jpeg" alt="Open challenges for AI engineering Simon Willison - simonwillison.net AI Engineer World's Fair, June 26th 2024" style="max-width: 100%" /&gt;&lt;/p&gt;

&lt;p&gt;At lunchtime on Wednesday last week I was asked if I could give the opening keynote at the &lt;a href="https://www.ai.engineer/worldsfair"&gt;AI Engineer World's Fair&lt;/a&gt;... on Thursday morning! Their keynote speaker from OpenAI had to cancel at the last minute and they needed someone who could put together a talk on &lt;em&gt;very&lt;/em&gt; short notice.&lt;/p&gt;
&lt;p&gt;I gave the closing keynote at their previous event last October - &lt;a href="https://simonwillison.net/2023/Oct/17/open-questions/"&gt;Open questions for AI engineering&lt;/a&gt; - so the natural theme for this talk was to review advances in the field in the past 8 month and use those to pose a new set of open challenges for engineers in the room.&lt;/p&gt;
&lt;p&gt;I continue to go by the rule of thumb that you need ten hours preparation for every hour on stage... and this was only a twenty minute slot, so I had just about enough time to pull it together!&lt;/p&gt;
&lt;p&gt;You can watch the result (and read the accompanying notes) at &lt;a href="https://simonwillison.net/2024/Jun/27/ai-worlds-fair/"&gt;Open challenges for AI engineering&lt;/a&gt;. I'm really happy with it - I got great feedback from attendees during the event and I think I managed to capture the most interesting developments in the field as well as challenging the audience to consider their responsibilities in helping shape what we build next.&lt;/p&gt;
&lt;h4 id="stripe-integration-for-datasette-cloud"&gt;Stripe integration for Datasette Cloud&lt;/h4&gt;
&lt;p&gt;Datasette Cloud has been in preview mode for &lt;em&gt;a while&lt;/em&gt; at this point. I'm ready to start billing people, and I've set a target of the end of July to get that in place.&lt;/p&gt;
&lt;p&gt;I'm using &lt;a href="https://stripe.com/"&gt;Stripe&lt;/a&gt; for billing, and attempting to outsource as much of the UI complexity of managing subscriptions to their &lt;a href="https://docs.stripe.com/customer-management"&gt;customer portal&lt;/a&gt;  product as possible.&lt;/p&gt;
&lt;p&gt;This has already resulted in one TIL: &lt;a href="https://til.simonwillison.net/pytest/pytest-stripe-signature"&gt;Mocking Stripe signature checks in a pytest fixture&lt;/a&gt; - and I imagine there will be several more before I have everything working smoothly.&lt;/p&gt;
&lt;h4 id="json-api-improvements-for-datasette-1-0"&gt;JSON API improvements for Datasette 1.0&lt;/h4&gt;
&lt;p&gt;Alex and I have been using Datasette Cloud to help drive progress towards the Datasette 1.0 release. Datasette Cloud needs a stable JSON API, so we've been working on finalizing the JSON API that will be included in Datasette 1.0.&lt;/p&gt;
&lt;p&gt;We worked together on a final design for this which Alex documented in &lt;a href="https://github.com/simonw/datasette/issues/2360"&gt;#2360: Datasette JSON API changes for 1.0&lt;/a&gt;. He's working on the implementation now, which we hope to land and then ship as an alpha as soon as it's ready for people to try out.&lt;/p&gt;
&lt;h4 id="weeknotes-1-jul-2024-claude-3-5-sonnet"&gt;Claude 3.5 Sonnet&lt;/h4&gt;
&lt;p&gt;I mentioned this above, but it's worth emphasizing quite how much value I've been getting out of Claude 3.5 Sonnet since &lt;a href="https://simonwillison.net/2024/Jun/20/claude-35-sonnet/"&gt;it's release&lt;/a&gt; on the 20th of June. It is &lt;em&gt;so good&lt;/em&gt; at writing code! I've also been thoroughly enjoying the new artifacts feature where it can write and then display HTML/CSS/JavaScript - I've used that for several prototyping projects as well as &lt;a href="https://simonwillison.net/2024/Jun/27/ai-worlds-fair/#slide.020.jpeg"&gt;quite a sophisticated animated visualization&lt;/a&gt; I used in my keynote last week.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/simonw/llm-claude-3/releases/tag/0.4"&gt;llm-claude-3 0.4&lt;/a&gt; has support for the new model, and I really need to upgrade some of my LLM-powered Datasette plugins to take advantage of it too.&lt;/p&gt;
&lt;h4 id="upgrades-to-my-blog"&gt;Upgrades to my blog&lt;/h4&gt;
&lt;p&gt;Last weeknotes I talked about &lt;a href="https://simonwillison.net/2024/Jun/19/datasette-studio/#more-blog-improvements"&gt;redesigning my homepage&lt;/a&gt; and adding entry images and tag descriptions.&lt;/p&gt;
&lt;p&gt;I've since made a bunch of smaller incremental improvements around here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I added &lt;a href="https://github.com/simonw/simonwillisonblog/issues/451"&gt;support for Markdown in quotations&lt;/a&gt;, for example the italics in &lt;a href="https://simonwillison.net/2024/Jul/1/terry-pratchett/"&gt;this quotation of Terry Pratchett&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Tags are now displayed on the homepage (and other pages) &lt;a href="https://github.com/simonw/simonwillisonblog/issues/455"&gt;for bookmarks and quotations&lt;/a&gt;, in addition to entries. This makes my tagging system a lot more prominent, so I've added descriptions to &lt;a href="https://simonwillison.net/dashboard/tags-with-descriptions/"&gt;a bunch more tags&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I created &lt;a href="https://2003.simonwillison.net/"&gt;2003.simonwillison.net&lt;/a&gt; (&lt;a href="https://github.com/simonw/simonwillisonblog/issues/452"&gt;#452&lt;/a&gt;), a special templated version of my homepage designed to imitate my site's design in 2003 (CSS rescued &lt;a href="https://web.archive.org/web/20030723185129if_/http://simon.incutio.com/"&gt;from the Internet Archive&lt;/a&gt;). I have my reasons.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/simonw/simonwillisonblog/issues/445"&gt;I redesigned the tag clouds on my year archive pages&lt;/a&gt; - e.g. on &lt;a href="https://simonwillison.net/2024/"&gt;2024&lt;/a&gt;. I actually used Claude 3.5 Sonnet for this - I gave it a screenshot of the tags and &lt;a href="https://gist.github.com/simonw/22b3a6aaa30ff96941ed4c1617c1bfd7"&gt;asked it to come up with a more tasteful palette of colours&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here's that new, slightly more tasteful tag cloud:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2024/tag-cloud-new-colours.jpg" alt="A tag cloud in muted colours, the largest tags are ai llms generativeai projects python openai ethics security llm claude" style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;h4 id="weeknotes-1-jul-2024-releases"&gt;Releases&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/datasette/releases/tag/0.64.8"&gt;datasette 0.64.8&lt;/a&gt;&lt;/strong&gt; - 2024-06-21&lt;br /&gt;An open source multi-tool for exploring and publishing data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/simonw/llm-claude-3/releases/tag/0.4"&gt;llm-claude-3 0.4&lt;/a&gt;&lt;/strong&gt; - 2024-06-20&lt;br /&gt;LLM plugin for interacting with the Claude 3 family of models&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="weeknotes-1-jul-2024-tils"&gt;TILs&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://til.simonwillison.net/pytest/pytest-stripe-signature"&gt;Mocking Stripe signature checks in a pytest fixture&lt;/a&gt; - 2024-07-02&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://til.simonwillison.net/npm/prettier-django"&gt;Running Prettier against Django or Jinja templates&lt;/a&gt; - 2024-06-20&lt;/li&gt;
&lt;/ul&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/blogging"&gt;blogging&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette"&gt;datasette&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/weeknotes"&gt;weeknotes&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/datasette-cloud"&gt;datasette-cloud&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="blogging"/><category term="datasette"/><category term="weeknotes"/><category term="datasette-cloud"/><category term="stripe"/></entry><entry><title>Quoting Michael Schade</title><link href="https://simonwillison.net/2023/Nov/5/michael-schade/#atom-tag" rel="alternate"/><published>2023-11-05T22:53:49+00:00</published><updated>2023-11-05T22:53:49+00:00</updated><id>https://simonwillison.net/2023/Nov/5/michael-schade/#atom-tag</id><summary type="html">
    &lt;blockquote cite="https://twitter.com/sch/status/1691232361378119680"&gt;&lt;p&gt;One of my fav early Stripe rules was from incident response comms: do not publicly blame an upstream provider. We chose the provider, so own the results—and use any pain from that as extra motivation to invest in redundant services, go direct to the source, etc.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p class="cite"&gt;&amp;mdash; &lt;a href="https://twitter.com/sch/status/1691232361378119680"&gt;Michael Schade&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/ops"&gt;ops&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;



</summary><category term="ops"/><category term="stripe"/></entry><entry><title>Stripe: Online migrations at scale</title><link href="https://simonwillison.net/2023/Nov/5/online-migrations-at-scale/#atom-tag" rel="alternate"/><published>2023-11-05T16:06:32+00:00</published><updated>2023-11-05T16:06:32+00:00</updated><id>https://simonwillison.net/2023/Nov/5/online-migrations-at-scale/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://stripe.com/blog/online-migrations"&gt;Stripe: Online migrations at scale&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
This 2017 blog entry from Jacqueline Xu at Stripe provides a very clear description of the “dual writes” pattern for applying complex data migrations without downtime: dual write to new and old tables, update the read paths, update the write paths and finally remove the now obsolete data—illustrated with an example of upgrading customers from having a single to multiple subscriptions.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="https://twitter.com/eatonphil/status/1721195409647829052"&gt;@eatonphil&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/databases"&gt;databases&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/migrations"&gt;migrations&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/zero-downtime"&gt;zero-downtime&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;



</summary><category term="databases"/><category term="migrations"/><category term="zero-downtime"/><category term="stripe"/></entry><entry><title>Scaling a High-traffic Rate Limiting Stack With Redis Cluster</title><link href="https://simonwillison.net/2018/Apr/26/redis-cluster/#atom-tag" rel="alternate"/><published>2018-04-26T18:34:25+00:00</published><updated>2018-04-26T18:34:25+00:00</updated><id>https://simonwillison.net/2018/Apr/26/redis-cluster/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://brandur.org/redis-cluster"&gt;Scaling a High-traffic Rate Limiting Stack With Redis Cluster&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Brandur Leach describes the simple, elegant and performant design of Redis Cluster, and talks about how Stripe used it to scaled their rate-limiting from one to ten nodes.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/rate-limiting"&gt;rate-limiting&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/redis"&gt;redis&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/scaling"&gt;scaling&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/brandur-leach"&gt;brandur-leach&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;



</summary><category term="rate-limiting"/><category term="redis"/><category term="scaling"/><category term="brandur-leach"/><category term="stripe"/></entry><entry><title>Implementing Stripe-like Idempotency Keys in Postgres</title><link href="https://simonwillison.net/2017/Oct/27/stripe-like-idempotency-keys-in-postgres/#atom-tag" rel="alternate"/><published>2017-10-27T17:51:52+00:00</published><updated>2017-10-27T17:51:52+00:00</updated><id>https://simonwillison.net/2017/Oct/27/stripe-like-idempotency-keys-in-postgres/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="https://brandur.org/idempotency-keys"&gt;Implementing Stripe-like Idempotency Keys in Postgres&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Having clients send “idempotency keys” with API requests in order to be able to safely retry them if something’s goes wrong is a really neat trick for making transactional APIs more robust. Here Brandur Leach talks implementation strategies.

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


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/api-design"&gt;api-design&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/idempotency"&gt;idempotency&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/postgresql"&gt;postgresql&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/brandur-leach"&gt;brandur-leach&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;



</summary><category term="api-design"/><category term="idempotency"/><category term="postgresql"/><category term="brandur-leach"/><category term="stripe"/></entry><entry><title>What is the best payment provider for a web app with monthly subscription fees at its early stage?</title><link href="https://simonwillison.net/2014/Feb/20/what-is-the-best/#atom-tag" rel="alternate"/><published>2014-02-20T17:35:00+00:00</published><updated>2014-02-20T17:35:00+00:00</updated><id>https://simonwillison.net/2014/Feb/20/what-is-the-best/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/What-is-the-best-payment-provider-for-a-web-app-with-monthly-subscription-fees-at-its-early-stage/answer/Simon-Willison"&gt;What is the best payment provider for a web app with monthly subscription fees at its early stage?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We found Stripe extremely easy to get started with for charging subscription payments.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/startups"&gt;startups&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/webapps"&gt;webapps&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="startups"/><category term="webapps"/><category term="quora"/><category term="stripe"/></entry><entry><title>What are the best set of marketing/payment tools for use in startup with a subscription webapp?</title><link href="https://simonwillison.net/2013/Dec/5/what-are-the-best/#atom-tag" rel="alternate"/><published>2013-12-05T09:28:00+00:00</published><updated>2013-12-05T09:28:00+00:00</updated><id>https://simonwillison.net/2013/Dec/5/what-are-the-best/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/What-are-the-best-set-of-marketing-payment-tools-for-use-in-startup-with-a-subscription-webapp/answer/Simon-Willison"&gt;What are the best set of marketing/payment tools for use in startup with a subscription webapp?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Stripe has excellent support for subscription payments, including helping manage recurring payments and pro-rataing for upgrades to plans half way through a billing cycle etc. I believe BrainTree offers similar tools.&lt;/p&gt;

&lt;p&gt;For email stuff, I strongly recommend looking in to &lt;span&gt;&lt;a href="http://www.mailgun.com/"&gt;Mailgun&lt;/a&gt;&lt;/span&gt; - they offer fantastic tools for advanced email sending. They don't have the same user-level engagement tools as something like Mixpanel or Intercom though.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/startups"&gt;startups&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/webapps"&gt;webapps&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/stripe"&gt;stripe&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="startups"/><category term="webapps"/><category term="quora"/><category term="stripe"/></entry></feed>