Facebook Pixel

Which fields should DevTinder index?

Email (unique) on User. (fromUserId, toUserId) compound unique on ConnectionRequest. (user1Id, user2Id) unique on Connection. (connectionId, createdAt) on Message. userId on Payment. Index the queries you actually run, not every field.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in DevTinder Database Schema Overview

User, ConnectionRequest, Connection (match), Message, Payment, and Subscription. Each handles a specific module: users, swipes, matches, chat, payments, and plan status.

It prevents duplicate swipe attempts (a user cannot swipe on the same target twice) and speeds up the most common query: "did A already swipe on B?" Compound unique indexes serve both integrity and performance.

A unique index on (user1Id, user2Id) where user1Id < user2Id ordering. This makes a match between A and B have one canonical form, so two requests cannot create the same match.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.