users of a large community site

I was going through a Django tutorial where they created a Reddit kind of app using Django users model for users.

from django.contrib.auth.models import User

class Post(models.Model):
    title = models.CharField(max_length=100)
    url = models.URLField()
    poster = models.ForeignKey(User, on_delete=models.CASCADE)
    created = models.DateTimeField(auto_now_add=True)
  1. What if we would have say 1 millions users ? Is django.contrib.auth.models.User still a good way to go or do we create a separate text field called users with custom functions ?

  2. When accessing the backend, what will happen where there are a million users ? Will there be a drop-down with a million options in the select input ?

My current goal is to create a large close-knit community site which obviously will not have 1 million users but there would be close to 10,000. But what would be the architecture of a million users site ? (Instagram is based on Django, how do they handle users table)

It’s less an issue with the number of rows in the database than with the frequency of use. I’m sure Instagram’s architecture is driven far more by the number of page- and image- requests per minute than by the raw number of users. (I’ve even more a minimalist than what Django implements. Personally, I believe the current AbstractUser is too big. I’d rather build off of AbstractBaseUser and make pretty much everything else as a related model - but I’m an extremist in that regards.)

I don’t think it’s going to matter much whether you use the default User model or create your own User model, as long as you keep the functionality in the model to an absolute minimum. At that scale, I’d think you’d definitely want to go with the Profile pattern for any additional attributes not absolutely required with every (or nearly every) request.

You definitely don’t want to use select lists with a large number of items. My opinion is that a select list becomes unusable at about 50 or so. After that, you probably want to use widgets like a search field or autocomplete or something like that instead of the default select list.