3 ms·
I find it strange that if I were designing tiktok's tables, I wouldn't call it tiktok_users ... It would be just called users
by keyle 4y ago
I find it strange that if I were designing tiktok's tables, I wouldn't call it
tiktok_users
...
It would be just called
users
- ollien 4y agoIt's been a long while, but I believe Django names tables with that exact convention.
- jorl17 4y agoIndeed it does. At a previous job we used to get rid of the convention. I've since thrown in the towel and said "meh"
- rtpg 4y agomore specifically for people who don't use it, the general naming is "module_modelname" (so for example "payments_paypaltransaction"). Django's term for what one might call a module is "app", which is also a bit of a loaded term, but the simple way of seeing it is that Django projects have many sub directories each managing a set of models (which map to DB tables, generally).
- LecroJS 4y agoHad the exact same thought, but after reading another comment it could make sense assuming it’s a 3rd party service integrated with tiktok
- hackernewds 4y agoMore plausible that there's WeChat_users and tiktok_users, as they don't just run 1 enterprise
- capableweb 4y agoAs a consultant/free-lancer I've seen this in plenty of SaaS businesses, even if they only have one product. The DB url would be "product-name.db.domain.tld/product-name", the database would be named "product-name" and the table would be called "product_name_users". Not really sure how it came to be, but it's not super uncommon. For products built by outsourced teams (or if initial prototype was built by a outsourced team but then taken over by in-house), it's more common, even when building products for others.
- larsnystrom 4y agoPrefixing table names with the app name is a simple way of letting multiple apps share the same database. Sharing the same database used to be really common, almost standard I’d say, when deploying on low-cost web hosts and also locally when working on multiple projects. I don’t let apps share databases anymore, but I still usually prefix table names anyway. Old habits die hard I guess, and for most ORMs it’s usually just a single config switch anyway.
- neurostimulant 4y agoNothing strange about it. ORMs like Django name their tables <app name>_<model name> by default.
- bradleybuda 4y agoOr musically_users
- dehrmann 4y agoAnd douyin_users
- smrtinsert 4y agoIt's not bad practice to namespace your tables. Especially if you launch other products or purchase another. Ah the monolith days...
- OJFord 4y agoI think it's silly too, but we (not TikTok) have some $company_$sensiblename tables. I think it may have originated with Django, there being a single Django 'app' when it was first set up, with the name $company; Django then uses that as a prefix for all the tables it creates. (Not suggesting TikTok ever used Django, that's just my suspicion in our case. Point is, it looks weird but it happens.)
- masklinn 4y agoIt could make sense because of the musical.ly merger, however in that case I would also expect finding TikTok’s original name somewhere (a.me or douyin), as well as references to musical.ly. If all traces of the renames and mergers have been scrubbed over time, then I would also expect the namespacing to have been removed (unless they expect more merger?)
- physicsguy 4y agoIt's not uncommon, especially in ORMs. For e.g. if I use django and call my app X then all my DB tables are by default prefixed with X