DEV Community

What I Learned While Architecting a Car Classified Marketplace: Real Engineering Problems & How I Solved Them

Most marketplace articles online talk about “features” or “user flow.”
But developers know the real work starts much deeper — database design, indexing, caching, concurrency, image pipeline, search performance, and data normalization.
I recently built a car classified marketplace end-to-end for a client, and I want to share the technical decisions that saved me from future disasters.
If you’re a developer building any marketplace (cars, real-estate, rentals, directory), this will help you avoid real bottlenecks.

1. Database Architecture Is the First Trap

Most devs start with a single listings table.
That works for week 1.
Then it collapses.
Cars have high-variance attributes.
You cannot store everything in columns like:
model, year, km, fuel_type, transmission, ownership, price
Because tomorrow you get:
• CNG + Hybrid
• “Imported model”
• Make-specific features
• Variant-specific attributes
The correct approach:
Use attribute buckets + normalized tables.
cars
id
user_id
dealer_id
make_id
model_id
year
base_price
created_at

car_attributes
id
car_id
attribute_name
attribute_value
This solved 90% of schema change pain.

2. Search Can’t Run on SQL Alone — Not for Cars

My client wanted filters like:
• Make / Model
• Price range
• KM range
• Transmission
• Ownership
• Fuel
• Verified badge
• City filter
• Nearby dealers
• Sorting by “Most relevant”
Trying to do this on MySQL with WHERE + LIKE + composite indexing…
Performance died immediately.
I moved search to Meilisearch, because it's:
• Lightweight
• Easier than Elasticsearch
• Instant to index
• Fast for numeric & text filters
The improvement:
SQL-only: ~1.2–2.1 seconds
Meilisearch: ~40–60 ms
The difference is enormous.

3. Image Pipeline Is a Hidden Monster

Car images = big files.
Users upload:
• 8–20 photos
• High resolution
• Duplicates
• Wrong rotation
• 10 MB+ files
If you let original uploads go directly to your server, you’re dead.
My solution:
• Upload → S3
• Lambda → auto compress, auto rotate, strip EXIF
• Generate 3 sizes: thumbnail, medium, full
• Store URLs in car_images table
• Maintain display_order for user sorting
This saved 70% storage and fixed page load metrics.

4. Listing Status Workflow Needs Real State Machines

Normal dev logic:
draft → active → sold → archived
Real-world workflow is way more complex:
draft
pending_review
rejected
active
boosted
expired
auto_renewed
sold
sold_offline
blocked
deleted_by_user
deleted_by_admin
I implemented a simple state machine pattern to avoid spaghetti logic.
class Listing {
changeStatus(from, to) {
const allowed = {
draft: ['pending_review', 'deleted_by_user'],
pending_review: ['active', 'rejected'],
active: ['expired', 'sold', 'blocked'],
...
}
}
}
This prevented state corruption and admin confusion.

5. Lead Routing System Needs Rate Limits + Noise Filtering

Most devs only build a “Send Request” button.
But here are the real issues:
• Same user sends 8 requests in 2 minutes
• Spam bots submit garbage
• Dealers get overwhelmed
• Same lead gets routed twice
I solved it using:
• IP + phone number throttling
• Hashing lead content to detect duplicates
• Lead scoring
• Auto-blocking disposable emails
• Event queue (RabbitMQ / Redis Streams) for routing
The result:
Dealers stopped complaining about repeated or fake leads.

### 6. API Layer Must Be Mobile-Optimized, Not “Web Ported”

Mobile traffic was 80%+, so the backend had to be tuned for apps.
Optimizations I applied:
✔ Compressed JSON responses
Objects with 20–30 fields became 30–60% smaller.
✔ Pagination with cursor-based system
Offset pagination was too slow on large datasets.
✔ Prefetch related data
Dealers needed aggregated counts:
• active listings
• sold listings
• leads this week
• package validity
Instead of making 4 queries from the app, API returns a single bundle.
✔ Smart caching using Redis
Cached:
• filters
• popular makes
• trending models
• top dealers
• homepage sections
API performance went from ~400ms to ~70ms.

7. Moderation Tools Save You More Than Any Feature

Tech issues I actually faced:
• Users uploading images of totally different cars
• KM manipulated (e.g., “1 km” for a 2015 model)
• Duplicate listings by dealers
• Fake seller names
• Fake phone numbers
What worked:
✔ Image duplication detection (phash hashing)
Same car posted by multiple users? → Flag it.
✔ KM validation rules
If km < 2000 and year < 2022 → review queue.
✔ Phone verification + cold-down
One phone → max 5 listings per 24 hrs.
✔ Admin quick-approve shortcuts
Admins could approve 50 listings in <10 mins.
Most devs underestimate how much engineering moderation takes.

8. Dealer Dashboard = A Mini CRM (Don’t Underbuild It)

Dealer workflows are complex.
I built:
• Inventory tracker
• Lead panel with timestamps
• Auto follow-up reminders
• WhatsApp integration
• Pricing plan manager
• Renewals & expiration alerts
• Bulk CSV upload + validation
• Logo + profile builder
This was 60% of development time.
Dealers are the power users — if their tools are bad, the platform fails.

9. Performance Monitoring from Day 1 Saved Me From Surprises

Added:
• OpenTelemetry traces
• Sentry for backend & frontend
• Slow query logs
• Custom metrics for search latency
• Image pipeline failure alerts
• API rate limit alerts
Without observability, debugging marketplace issues becomes impossible.

Final Developer Takeaway

If you're building a marketplace:
✔ Normalize dynamic attributes
✔ Use search engine (not SQL) for filtering
✔ Build serious image processing
✔ Implement a proper state machine
✔ Add lead throttling
✔ Design mobile-first APIs
✔ Build deep moderation tools
✔ Treat dealer dashboard as a CRM
✔ Add observability early
This project taught me that marketplace architecture is messy, unpredictable, and deeply technical — but extremely rewarding when it finally works smoothly.
If any developer wants breakdowns, code snippets, or architecture diagrams, just tell me.

Top comments (0)