AdvancedBackend
Backend vs Local Mode
Choose the right approach for your use case
Overview
ImportCSV can be used in two modes:
- Local Mode: Configuration in frontend code
- Backend Mode: Configuration stored in database, managed via admin dashboard
Feature Comparison
| Feature | Local Mode | Backend Mode |
|---|---|---|
| Setup Complexity | Simple (npm install) | Requires backend + database |
| Configuration | In code | Admin dashboard |
| Authentication | Optional | Required (Clerk) |
| Column Management | Hard-coded | Dynamic via UI |
| Validation Rules | In code | Configurable UI |
| Webhook Support | Manual implementation | Built-in |
| Background Processing | No | Yes (Redis Queue) |
| Configuration Storage | Frontend code | PostgreSQL database |
| API Access | No | Full REST API |
| Multi-environment | Code duplication | Shared configs |
When to Use Local Mode
- Quick prototypes or POCs
- Simple, static import requirements
- Minimal infrastructure preferred
- Configuration as code approach
Local Mode Example
<CSVImporter
columns={[
{
id: 'email',
label: 'Email',
type: 'email',
validators: [{ type: 'required' }]
},
{
id: 'name',
label: 'Name',
validators: [{ type: 'required' }]
}
]}
onComplete={(data) => console.log(data)}
/>When to Use Backend Mode
- Centralized configuration management
- Non-developers managing importers via UI
- Webhook notifications and background processing
- Authentication and multi-app configuration reuse
- API access for programmatic control
Backend Mode Example
// Configuration stored in database, managed via admin
<CSVImporter
importerKey="cust_import_001"
apiUrl="https://api.yourapp.com"
onComplete={(data) => console.log(data)}
/>Migration Path
- Set up backend: PostgreSQL + Redis + FastAPI + Clerk auth
- Create importers: Recreate columns and validation rules in admin UI
- Update frontend:
// Before: <CSVImporter columns={[...]} onComplete={handleComplete} /> // After: <CSVImporter importerKey="your-key" apiUrl="https://..." onComplete={handleComplete} />
Performance Considerations
Local Mode
- Bundle Size: All configuration in frontend bundle
- Processing: Client-side only
- Scalability: Limited by browser resources
Backend Mode
- Bundle Size: Minimal (just importer key)
- Processing: Server-side with Redis Queue
- Scalability: Horizontal scaling possible
Decision Matrix
| Requirement | Recommended Mode |
|---|---|
| Quick prototype | Local |
| Production SaaS app | Backend |
| Single developer | Local |
| Team collaboration | Backend |
| Simple imports | Local |
| Complex validation | Backend |
| Webhook notifications | Backend |
| Multiple environments | Backend |
| Minimal infrastructure | Local |
| Enterprise features | Backend |
Hybrid Approach
Start with local mode for your MVP, then migrate to backend mode as needs grow. This minimizes initial complexity while providing a clear upgrade path.