
Executive Summary
Dify.AI, the second most popular LLM tool on GitHub with 70,000+ stars, has transformed their data architecture using TiDB Cloud Serverless to solve a critical challenge in GenAI platform development. By consolidating an extensive number of database containers into a unified system, they’ve created a scalable foundation serving thousands of developers building AI applications while achieving remarkable efficiency gains:
- 80% reduction in infrastructure costs
- 90% decrease in operational overhead
Key Technology Stack
- Core Database: TiDB Cloud Serverless (unified storage layer)
- AWS Infrastructure: EC2(compute), Bedrock (flexible knowledge service)
This transformation demonstrates how unified database architecture can significantly reduce operational complexity while enabling rapid AI application development at scale.
Dify.AI has emerged as a remarkable success story in the open-source community, revolutionizing how businesses build and deploy AI applications. As a leading no-code generative AI development platform, Dify.AI enables organizations to create sophisticated AI applications through intuitive visual workflows, without requiring deep technical expertise.
Starting from humble beginnings in 2023, the company has rapidly grown to become the second most popular LLM tool on GitHub, boasting over 70,000 stars and more than 630 contributors. Their platform supports thousands of developers worldwide, handling everything from chatbots and content generation to sophisticated document analysis and AI-powered workflows.
“There’s such a great chasm between getting started with GenAI and building a production-ready app,” explains the Dify.AI team. “While it’s easy to experiment with ChatGPT or copy a demo, creating real business value through AI applications remains a significant challenge. This is the gap we’re bridging.”
As part of NVIDIA’s incubator program, they’re not just building tools – they’re reshaping how organizations approach AI development, making enterprise-grade AI applications accessible to companies of all sizes.
Challenge: Managing Massive Database Containers in AI Development
When Dify.AI began their journey as a GenAI platform provider, they encountered a scenario familiar to many in the industry. Their platform needed to handle multiple data types simultaneously – from traditional relational data to vector embeddings, from document storage to conversation histories. Like many others in the field, the platform’s multi-tenant architecture forced them to manage an unwieldy sprawl of isolated database containers – reaching near half a million, one for each developer’s unique dataset.
The complexity wasn’t just in the technology – it was affecting their ability to innovate and serve their customers effectively. As a no-code GenAI platform, Dify.AI faced a typical challenge shared by SaaS providers: they needed to solve problems not just for themselves, but for thousands of tenants – speciffically in Dify.AI’s scenario – developers building AI applications on their platform. This is where their story intersects with a fundamental shift in how GenAI platforms are built and operated.
“Managing separate databases for different data types wasn’t just complex – it was holding us back from focusing on what really mattered: building better AI applications,” reflects the Dify.AI team.
Solution: A Unified Transformation with TiDB
The solution came in the form of a unified approach that fundamentally rethought how GenAI platforms can manage their data layer:

This architecture represents more than just technical integration; it illustrates how Dify.AI has consolidated its entire data infrastructure into a cohesive system that seamlessly manages data from ingestion to AI-powered applications. The architecture is structured as follows:
- User Interaction Layer: The process begins with a user-friendly interface where users input data and queries. This layer is crucial for engaging end-users and ensuring a smooth interaction flow.
- Dify Data Pipeline:
- Once user input is received, it flows into the Dify Data Pipeline. Here, raw data is ingested from multiple sources—such as documents, tables, lists, and images—and undergoes advanced processing steps including chunking and named entity recognition. This prepares the data for embedding generation, ensuring it is ready for AI applications.
- The Dify Processing Engine manages workflows and integrates results to generate insightful responses based on user queries.
- TiDB Unified Storage: Central to this architecture, TiDB offers a unified solution for various data types, including but not limited to:
- Operational Data Processing: Efficient management of transactional and real-time data.
- Knowledge Graph Storage: Supports structured relationships for enhanced insights.
- Vector Store: Enables embeddings for similarity searches in AI applications.
- Document Store: Stores raw content for easy retrieval of unstructured data.
TiDB’s support for both relational and non-relational data allows developers to manage diverse datasets in one place, simplifying operations and reducing complexity.
- AWS Infrastructure Integration: The entire system operates on AWS infrastructure, leveraging:
- Elastic compute resources via AWS EC2 to accommodate fluctuating workloads.
- Comprehensive storage solutions such as S3 for large datasets and EBS for persistent storage.
- Integration with AWS Bedrock enables access to pre-trained models from various LLM providers, enhancing Dify.AI’s capabilities in delivering external knowledge services.

Dify.AI dramatically simplified their infrastructure by consolidating near half a million database containers into a single TiDB Cloud implementation, significantly reducing operational complexity and maintenance overhead.
The unified solution enables practical AI features including built-in knowledge base functionality and seamless RAG implementation, with automatic document processing and combined storage of content and vector embeddings in single tables.
Developers benefit from rapid prototyping capabilities through simple SQL-based queries that work seamlessly for both traditional and vector data, eliminating the need to learn multiple query languages or manage separate systems. The platform’s scale-to-zero capabilities ensure cost optimization, allowing resources to automatically adjust based on actual usage while maintaining high performance.

What’s particularly interesting about this implementation, is how it enables us to handle both traditional database operations and AI-specific requirements like vector similarity search in a single system. This wasn’t just an infrastructure upgrade – it was a complete transformation of how we build and scale our platform.
💡Technical Edge: Unified Intelligence Infrastructure
The transformation with TiDB delivered three core technological advantages that fundamentally changed how Dify.AI builds and scales their platform:
- Unified Data Processing
- Single Source of Truth: Consolidated storage for all data types – documents, vectors, chat histories, and traditional relational data
- Simplified Architecture: Reduced complexity from multiple specialized databases to one unified system
- Enhanced Performance: Optimized query patterns for both traditional and vector operations
- Scalable Multi-tenant Design
- Isolation: Dedicated logical spaces for each customer while sharing physical resources
- Resource Management: Automatic scaling based on customer workload
- Cost Efficiency: Pay-per-use model with scale-to-zero capabilities
- Integrated Vector Operations
- Native Vector Support: Built-in similarity search capabilities
- Hybrid Queries: Combine traditional SQL with vector operations
- Flexible Indexing: Automatic index management for optimal performance
Quantifiable Outcomes: Efficiency Up, Cost Down
The transformation has delivered quantifiable improvements across multiple dimensions:
⚡️ Infrastructure Simplification | 🔧 Operational Relief | 💰 Infrastructure Efficiency |
From managing hundreds of thousands of siloed database containers to a unified, coherent system. | Cut database maintenance efforts by 90%, freeing engineers to focus on core AI capabilities | Achieved 80% cost reduction via consolidated resource pooling and auto-scaling |
Looking Forward
This architectural shift positions Dify.AI at the forefront of GenAI development innovation. With RAG workflows now running on TiDB Serverless, the team is exploring advanced capabilities like real-time knowledge graph updates and cross-modal query optimization – innovations that would have been impractical with their previous infrastructure.
TiDB has proven to be more than just a database solution; it’s become a strategic enabler for AI-first companies. By unifying vector search, knowledge graphs, and operational data in one system, it eliminates the complexity of managing multiple databases while delivering enterprise-grade reliability.
“Our experience with TiDB has been exceptional,” notes the Dify.AI team. “The platform’s ability to handle diverse requirements within a single system – from knowledge graph management to document storage and chat history – aligns perfectly with our vision for simplified, powerful AI development.”
“What we’ve built with TiDB isn’t just about solving today’s challenges,” the team adds. “It’s about creating a foundation that can evolve with our needs and those of our customers.”
