<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz" -->

---
title: The AI Code Works, But It Wont Scale | daily.dev
description: AI-generated code for a to-do app works functionally but has a critical scalability flaw: it loads all records from the database and filters them in-memory...
canonical: https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The AI Code Works, But It Wont Scale | daily.dev
og:description: AI-generated code for a to-do app works functionally but has a critical scalability flaw: it loads all records from the database and filters them in-memory...
og:url: https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz
og:image: https://api.daily.dev/og/posts/Y5exvgsZZ.png
og:image:alt: The AI Code Works, But It Wont Scale
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The AI Code Works, But It Wont Scale

**[Dan Vega](https://daily.dev/sources/dan-vega)** · 1 min read · 0 upvotes · 0 comments

## Summary

AI-generated code for a to-do app works functionally but has a critical scalability flaw: it loads all records from the database and filters them in-memory using Java streams, with no pagination. This approach is fine for small datasets but becomes a performance bottleneck as data grows. The fix involves pushing filtering and pagination down to the database layer rather than handling it in application code.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=42LTuIacA7s>

## Similar posts on daily.dev

- [Java Developers Are Using AI Wrong. Here’s the Workflow That Made Me 10x Faster.](https://daily.dev/posts/java-developers-are-using-ai-wrong-here-s-the-workflow-that-made-me-10x-faster--f48frvg5s) · Medium · 12 upvotes · 0 comments
- [Why you care ? Which layer should process your data](https://daily.dev/posts/why-you-care-which-layer-should-process-your-data-koxxy4i2c) · Javarevisited · 0 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#ai-coding](https://daily.dev/tags/ai-coding)

[View this post on daily.dev](https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The AI Code Works, But It Wont Scale","url":"https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz"},"datePublished":"2026-08-01T12:56:44.552Z","dateModified":"2026-08-01T12:56:59.894Z","description":"AI-generated code for a to-do app works functionally but has a critical scalability flaw: it loads all records from the database and filters them in-memory...","image":"https://i.ytimg.com/vi/42LTuIacA7s/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/42LTuIacA7s/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Dan Vega","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Dan Vega","logo":"https://media.daily.dev/image/upload/s--qCQZxa91--/f_auto,q_auto/v1773648785/logos/dan-vega?_a=BAMAMiiu0","url":"https://daily.dev/sources/dan-vega"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-ai-code-works-but-it-wont-scale-y5exvgszz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,ai-coding","timeRequired":"PT1M","video":{"@type":"VideoObject","name":"The AI Code Works, But It Wont Scale","description":"AI-generated code for a to-do app works functionally but has a critical scalability flaw: it loads all records from the database and filters them in-memory...","thumbnailUrl":"https://i.ytimg.com/vi/42LTuIacA7s/sddefault.jpg","uploadDate":"2026-08-01T12:56:44.552Z","duration":"PT1M","url":"https://api.daily.dev/r/Y5exvgsZZ","embedUrl":"https://www.youtube.com/embed/42LTuIacA7s"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Dan Vega","item":"https://daily.dev/sources/dan-vega"},{"@type":"ListItem","position":3,"name":"The AI Code Works, But It Wont Scale"}]}
```

