<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chad Bell on Medium]]></title>
        <description><![CDATA[Stories by Chad Bell on Medium]]></description>
        <link>https://medium.com/@chadbell045?source=rss-20b48bd6a32a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7MBFbRZQ7aG1_II-aL_1EQ.png</url>
            <title>Stories by Chad Bell on Medium</title>
            <link>https://medium.com/@chadbell045?source=rss-20b48bd6a32a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:03:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chadbell045/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploying TanStack Start on Cloud Run with Docker + Bun]]></title>
            <link>https://medium.com/@chadbell045/deploying-tanstack-start-on-cloud-run-with-docker-bun-d4e66c246557?source=rss-20b48bd6a32a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4e66c246557</guid>
            <category><![CDATA[tanstack-start]]></category>
            <category><![CDATA[tanstack-query]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[google-cloud-run]]></category>
            <dc:creator><![CDATA[Chad Bell]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 16:11:01 GMT</pubDate>
            <atom:updated>2026-01-28T16:42:45.847Z</atom:updated>
            <content:encoded><![CDATA[<h4>TL;DR: We shipped a TanStack Start app on Cloud Run using Bun and Docker, and it’s the fastest dev + prod experience I’ve had in years.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1dlvdzGwdN3tJxYP7ulzg.png" /></figure><p>A few months ago, I was tasked with picking a framework for my company’s new greenfield project — a highly interactive full-stack web app.</p><p>My first instinct was to reach for Nextjs; I was ready to sell our souls to the beast, pay for Vercel, and leverage server actions for all they’re worth.</p><p>But I started to worry about all of the out of the box features I would be missing, many of them from TanStack Query: what happens when someone comes back from lunch and simply clicks on their browser window (i.e. refetch on window focus)? What happens when I want an infinite scroll list and I can’t use a typical server action?</p><p>But the thing that really tipped the scale for me — Nextjs just feels so slow to develop in! I understand lazily compiling routes is amazing for huge enterprise projects, but more and more I was feeling that our comparatively tiny web app needed something different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bFx7GTd_VsqB_q_aQFIHPA.png" /><figcaption>Screenshot from the TanStack Website</figcaption></figure><h3>Enter TanStack Start</h3><blockquote>TanStack Start is a full-stack React framework powered by TanStack Router. It provides a full-document SSR, streaming, server functions, bundling, and more.</blockquote><p>I heard about TanStack Start, decided I would try it out, and soon fell in love with it.</p><ul><li>The dev server, powered by vite, is super fast.</li><li>Prefetching actually works in dev, so you can see what it will be like deployed.</li><li>useEffect, useState, use whatever the heck you want to because every page is interactive by default.</li><li>And yet the first page load still feels magical because it’s powered by initial SSR.</li></ul><h3>Deploying on Cloud Run</h3><p>One of my favorite parts is how easy it was to deploy — instead of managing separate frontend and backend deployments, all I have now is a simple Google Cloud Run container powering the entire full-stack application.</p><p>Initially I had problems with long build times on Google Cloud Build, but after upgrading to <strong>Vite 8 and Rolldown</strong>, my build and deploy times went under 3 minutes.</p><pre>{<br>  ...<br>  &quot;scripts&quot;: {<br>    &quot;dev&quot;: &quot;bun --bun vite dev --port 3000&quot;,<br>    &quot;build&quot;: &quot;bun --bun vite build&quot;,<br>    &quot;preview&quot;: &quot;bun --bun vite preview&quot;,<br>    &quot;start&quot;: &quot;bun run .output/server/index.mjs&quot;<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;@tanstack/react-start&quot;: &quot;^1.150.0&quot;,<br>     ...<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;@types/bun&quot;: &quot;^1.3.6&quot;,<br>    &quot;vite&quot;: &quot;^8.0.0-beta.10&quot;<br>    ...<br>  }<br>}</pre><h4>Dockerfile</h4><p>There weren’t a lot of good guides online for what the actual Dockerfile should look like, especially using bun. I wanted to share my initial version, though I’m totally open to feedback on this since I don’t pretend to be a Docker expert:</p><pre># ---------- Build stage ----------<br>FROM oven/bun:latest AS builder<br>WORKDIR /app<br><br>COPY package.json bun.lock ./<br>RUN bun install --frozen-lockfile<br><br>COPY . .<br>RUN bun run build<br><br># ---------- Runtime stage ----------<br>FROM oven/bun:latest<br>WORKDIR /app<br><br>COPY --from=builder /app/.output ./.output<br>COPY --from=builder /app/package.json ./<br><br>EXPOSE 8000<br>CMD [&quot;bun&quot;, &quot;run&quot;, &quot;start&quot;]</pre><p>Note: I did follow the suggestion in this GitHub comment to prevent a flash of unstyled content (FOUC) while using TanStack + TailwindCSS + Docker: <a href="https://github.com/TanStack/router/issues/5812#issuecomment-3519114753">https://github.com/TanStack/router/issues/5812#issuecomment-3519114753</a></p><p>With Cloud Run’s cold starts, this spins up in around ~5 seconds. Once we start having more users, we’ll probably just always keep 1 instance on and then scale up as needed.</p><h3>Prod is <em>FAST</em></h3><p>With dev feeling so fast, I was worried that I would be disappointed once we deployed.</p><p>Wrong.</p><p>The deployed site feels so snappy I was almost giddy.</p><p><strong>The powerful combination of prefetching + loaders + ensureQueryData + useSuspenseQuery makes the site feel so smooth.</strong> I hardly ever saw a loading skeleton or weird flash of loading state.</p><p>And this is all with the cheapest Postgres database GCP offers, a Cloud Run container with 512 MB of Ram and 1 CPU 😳</p><p>Every deployed page felt just like it did in dev — snappy and interactive instantly.</p><h3>The Right Tool for the Job</h3><p>Obviously Nextjs is a powerful framework, and this post isn’t to hate on it. But as I read in TkDodo’s blog while setting up this project, <strong>use the right tool for the job</strong>.</p><p>For us, the interactive by default nature of TanStack Start was perfect, and it came with the bells and whistles I was looking for in Nextjs (like SSR and API routes).</p><p>Thanks to Tanner Linsley and the team — 1 month ago I took a gamble on TanStack Start, and Monday was payday!!!</p><p>Yes, I wrote this entire article by hand, and yes, I like em dashes. It’s a shame they’ve been ruined 😂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4e66c246557" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dash: Polars vs Pandas]]></title>
            <link>https://medium.com/@chadbell045/dash-polars-vs-pandas-a02ac9fcc484?source=rss-20b48bd6a32a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a02ac9fcc484</guid>
            <category><![CDATA[polar]]></category>
            <category><![CDATA[dash]]></category>
            <category><![CDATA[plotly]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[dataframes]]></category>
            <dc:creator><![CDATA[Chad Bell]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 20:27:39 GMT</pubDate>
            <atom:updated>2024-04-17T21:04:13.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Polar bear kicking a panda bear" src="https://cdn-images-1.medium.com/max/1024/1*guBEZJ5nV0HjDVZbvpkiJw.png" /><figcaption>Credit: Google Gemini</figcaption></figure><h3>Pandas: The Reigning Champion</h3><p>I love <a href="https://pandas.pydata.org/docs/getting_started/index.html">Pandas</a>.</p><p>Pandas is the library that introduced me to the <a href="https://pandas.pydata.org/docs/user_guide/dsintro.html#dataframe">DataFrame</a> world. It’s with Pandas that I learned about tidy data, wrangling, and aggregations. Pandas is like the grandfather of DataFrames for Python: maybe a little old, maybe a little slow, but time-tested and widely used.</p><blockquote>Pandas is like the grandfather of DataFrames for Python: maybe a little old, maybe a little slow, but time-tested and widely used.</blockquote><p>So it’s no surprise that when I was first introduced to <a href="https://pola.rs/">Polars</a>, I was more than a little skeptical. The syntax was unfamiliar and the community was still relatively small. Unlike Pandas, there weren’t hundreds of thousands of answers on stack overflow to learn from (even today, as of this writing, there are 157 times more questions tagged Pandas compared to Polars-Python).</p><p>But over the past few months, I’ve grown to love Polars and almost completely made the switch inside my <a href="https://dash.plotly.com/">Dash</a> apps. This article aims to share a few things I’ve learned.</p><h3>Polars: The Contender</h3><p>Polars, in comparison, is the cool new tech-savvy grandchild. Built with modern tools (written in Rust), it’s blazingly fast with big data, but still new to the DataFrame space.</p><p>Why make the switch from Pandas to Polars?</p><p>There are a million articles on this subject already, so I won’t bore you with the details. But in short, Polars is</p><ul><li>more expressive in its API (the code is easier to write and read)</li><li>Lazily executed (data isn’t all loaded into memory)</li><li>“Blazingly fast” (seriously!)</li></ul><p>For example, the code to filter by a column goes from this:</p><pre># Pandas<br>df[(df[&#39;year&#39;]==2007) &amp; (df[&#39;country&#39;]==&#39;Armenia&#39;)]</pre><p>to this:</p><pre># Polars<br>df.filter(year=2007, country=&#39;Armenia&#39;)</pre><p>That just feels cleaner, doesn’t it?</p><h3>Dash: The Arena</h3><p>I also love creating Plotly Dash apps, which are web apps created using pure Python. Dash is the best way I’ve found to power data-intensive, highly customizable apps.</p><p>So, I thought I would create a Dash app to interactively compare the two DataFrame libraries (Polars and Pandas). Here is the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D0_x-kPT1MMkByl3hmuGeQ.png" /><figcaption>Dash: Polars vs Pandas</figcaption></figure><p>You can visit the app live here: <a href="https://dash-polars-pandas-docker.onrender.com/">https://dash-polars-pandas-docker.onrender.com</a></p><p><em>(Because it is hosted for free, the app might take a minute to turn on and load)</em></p><p>Once you are in the app, you can explore three pages: A minimal Dash app rewritten in Polars, some common Polars queries written for Dash, and a Speed Comparison of the two libraries.</p><h3>App Pages</h3><h4>1. Minimal Dash App (in Polars)</h4><p>In the Dash documentation, there is an example of a minimal Dash app. This page is the same, but rewritten with Polars instead of Pandas for the DataFrame library.</p><p>As you can tell from this page, the syntax is a little different, but it isn’t too difficult to switch out Pandas with Polars in such a simple app.</p><h4>2. Polars Dash Recipies</h4><p>This page serves as a sort of cheat sheet for translating code between Pandas and Polars. It has some common operations for the libraries, and highlights differences specific to Dash.</p><p>Here are a few of those code snippets that are significantly different in Pandas vs. Polars and are commonly used in Dash:</p><p><strong>Getting Unique Column Values </strong>(e.g. for a dropdown)</p><pre># Pandas<br>df.country.unique()<br><br># Polars<br>df.get_column(&#39;country&#39;).unique().to_list()</pre><p><strong>DataFrame To Dash Ag-Grid</strong></p><pre># Pandas<br>dag.AgGrid(<br>  columnDefs=[{&quot;field&quot;: c} for c in df.columns],  <br>  rowData=df.to_dict(&#39;records&#39;),<br>)<br><br># Polars<br>dag.AgGrid(<br>  columnDefs=[{&quot;field&quot;: c} for c in df.columns],  <br>  rowData=df.to_dicts(), # Note: df.to_dict() will not work.<br>)</pre><h4>3. Speed Comparison</h4><blockquote>Disclaimer: Before anyone roasts me, I know this isn’t a real benchmark. There are other factors in a live app, and some of the queries could be optimized with LazyFrames. But, it gives you a general idea of how the two libraries stack up :)</blockquote><p>The speed comparison has 5 example queries, written side by side in Pandas and Polars. The first two are familiar examples from the Titanic dataset and don’t require much work. The final three are from the TCP-H benchmark (so the callbacks don’t time out, they only use a subset of the data).</p><p>The page is interactive and allows you to test each of these queries yourself by clicking, “Run Query.” Then, you can see the speed difference between the two libraries in real-time.</p><p>The first query reads from a csv, and for some reason, Polars often is slower on the first run. But on subsequent runs, Polars is 2x-3x faster.</p><p>The last, most intense query, is where Polars really shines. With lazy execution, Polars is able to complete the query 10x–15x faster than Pandas!</p><h3>The Winner: ?</h3><p>Pandas is still a great DataFrame library, and the ecosystem built around it can’t transition overnight.</p><p>But in my Dash apps, I am using Polars! I’ve noticed a speed increase and hope it provides a better experience for my users. Plus, it is just fun to use!</p><p>Need to use a favorite library that doesn’t play nice with Polars yet? You can always throw a .<a href="https://docs.pola.rs/py-polars/html/reference/dataframe/api/polars.DataFrame.to_pandas.html">to_pandas</a>() on the end and keep rolling (like the upstart kid driving a classic car 😁).</p><p>Who will be the final winner in the DataFrame arena? Time will tell — but my bet is on Polars!</p><p><em>Questions, comments, or concerns about the app? Need help making the jump from Pandas to Polars (especially in your Dash app)? </em><a href="/service/mailto:chadbell045@gmail.com"><em>Let me know</em></a><em>!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a02ac9fcc484" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A blog written entirely by ChatGPT]]></title>
            <link>https://medium.com/@chadbell045/a-blog-written-entirely-by-chatgpt-bb29d02a6c1c?source=rss-20b48bd6a32a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb29d02a6c1c</guid>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[blogging]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Chad Bell]]></dc:creator>
            <pubDate>Thu, 26 Jan 2023 18:31:27 GMT</pubDate>
            <atom:updated>2024-03-20T21:25:49.413Z</atom:updated>
            <content:encoded><![CDATA[<h3>A blog post written entirely by ChatGPT</h3><p>We’ve all been there — searching google for some passive way to make income. Unfortunately for us millennials, making money takes work, something most of us are hesitant to do. I discovered blogging on Medium, and it seemed like it could be a good option.</p><p>But let’s be honest: am I going to sit down every day and consistently blog about my boring data analytic skills? No.</p><p>I simply am never going to do that.</p><p>And no one is ever going to read that.</p><p>But then the question came to my mind: could I create a blog post entirely written by ChatGPT?</p><p>I have been amazed by ChatGPT’s capabilities. As a university student (and an honest one at that), I can see how this new technology could completely redefine the way we write. Papers that would takes me hours to write can be hashed out by ChatGPT in seconds.</p><p>And even crazier, ChatGPT’s work is free of plagiarism. It is authentically created just for me.</p><p>So without further adieu, I introduce the first of what may be many articles by ChatGPT. It is somewhat ironically named, “<strong>The Rise of Virtual Reality: How it’s Changing the Way We Live and Work</strong>”</p><p>Me: “Can you write me an interesting article for Medium.com?”</p><p>ChatGPT: “Virtual reality (VR) has come a long way since its early days as a gimmick or a toy for gamers. Today, VR technology is being used in a wide range of industries, from entertainment to healthcare to education, and it’s having a major impact on the way we live and work.</p><p>One of the most exciting areas of growth for VR is in entertainment. From video games and movies to theme parks and live events, VR is giving audiences new and immersive ways to experience their favorite content. For example, in the gaming industry, VR headsets like the Oculus Rift and the PlayStation VR are becoming increasingly popular, allowing players to feel as if they’re inside the game. Similarly, in the movie industry, VR experiences are being used to give audiences a more interactive and engaging way to watch their favorite films.</p><p>Another area where VR is making a big impact is in healthcare. Surgeons are using VR simulations to practice complex procedures before performing them on real patients, and therapists are using VR to help patients with conditions like PTSD and phobias. In addition, researchers are exploring how VR can be used to help patients with chronic pain and other conditions manage their symptoms.</p><p>Education is also an area where VR is having a significant impact. Teachers are using VR simulations to take students on virtual field trips and to bring difficult-to-understand concepts to life. Additionally, students can use VR to practice skills and explore new topics in a safe, immersive environment.</p><p>Finally, VR is also changing the way we work. Companies are using VR to train employees, design products, and conduct virtual meetings. In addition, virtual and augmented reality are being used in many manufacturing industries and construction sites to improve the efficiency of the process and also to check the design and accuracy.</p><p>Overall, the rise of virtual reality is changing the way we live and work in ways we couldn’t have imagined just a few years ago. As the technology continues to improve and become more accessible, we can expect to see even more innovative uses for VR in the future.”</p><p>6 beautiful paragraphs.</p><p>All written in less than 60 seconds.</p><p>So what do you think? How did you like the article? Leave a comment below and be sure to follow me for more ChatGPT blog posts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb29d02a6c1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>