Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I’m no database expert by any stretch, but why the hell would you have the table with just the name in it if there are only two tables, surely there is no need for a relationship. one table would suffice?
-
arekxv10527yUsing strings as foreign keys is a really bad choice performance wise but if its a table which will have a small amount of rows (like less than 1000) from now and forever, then that is not a big deal. On the other hand. I think its dumb to use two tables to represent a parent-child relationship. They do know that a table can refer to itself? 😃
-
@coopaaaah @arekxv Yeah. Using string... That's why I'm asking what database this is.
-
coopaaaah577y@arekxv I'm sure they do. In some cases the parent will be very small, but the child table it's referencing certainly won't.
The project is about managing batch jobs. In this scenario, the parent here would be a app, and the child is the batch that ran for that app. With how they've designed it, a row would be created for each batch that's run for said app.
The state of said batch is also managed in that table. I tried to expand it out and say this would not preform well, especially for the UI,but I couldn't get anywhere with them.
Related Rants
I can't convince my team that a good database model promotes a good API design and a good UI/UX experience.
Instead, I have to work with a ridiculous table setup.
Imagine, if you will, a table (table B) that references another table (table A) via a foreign key. The FK is a string in both tables. And table A only has one column, which is labeled as "name".
The schema i have to look at it kind of like this:
Table parent
Name varchar(10) primary key
Table child
Name varchar (10),
parent_name varchar(10),
Foreign key (parent_name) references parent (name)
Sorry if the syntax is wrong, a little frustrated having to look at it...
Am I crazy to want to change this table design? Am I missing something? I feel like I'm taking crazy pills, because this is just scratching the surface of the problems I have to deal with.
rant
sql
database
design