« first day (3276 days earlier)      last day (1042 days later) » 

8:15 AM
hello everybody
I have a hypothetical issue and I need some advice
 
8:28 AM
No. She might be pretty but she is your sister. There are other girls out there....... i mean ehh.... whats your issue?
 
Morn
@Tomm looking for a new gig. The current one sucks, way too much. But we should be good.
@Zulatin lmaooooo
@MwBakker shoot dude.
 
8:45 AM
Alright
I am working on an app that indicates automotive related cases (events / workshops etc)
I want someone who is registering his event / workshop to choose to which brands are related to that matter
 
@MwBakker so far, ok
 
In order to prevent many-to-many relations I would register a table like company_x_brand for each brand the workshop/event is related to
BUT it can include many car brands, which would include a lot of calls to my database. It's FireStore so that is costly
I am tempted to put all related brands into an array and put that in the column
 
@MwBakker if you do so, what are the pros and cons?
 
To pros are less database calls
the cons are .. well.. it's an array of strings in a column
which is a no-go for me, learned by school
 
can you not put the brands, in something separate that would not be part of the db design?
 
8:52 AM
Yes, I could put the brands in a file
 
what are the security risk, if you put the brand in a file?
 
But in order to know in what brands a certain company is specialist in I would require that to be registered in the db
 
(just asking)
if you index the column
 
9:16 AM
You mean order the brand?
I want cars to 'match' with the specialist company
Sorry I lost connection to internet for a while
 
MwBakker, do one thing. add the car brands in db schema.
when your application starts.. call and hold all of the static data

such as brands? and cars in stock?
now that static data should stay in memory i.e. your application.
whenever any user does something... check or match data from that memory.
if you aware of OOP.
then let's say..

an static class would carry all the static data.
that will be used by all users.. regardless of session.
this way you won't have to hit db again and again.
 
Ok I can find you in the car brand list in a static class
 
unless there is something you don't find in the data from that static class
then go in db make sure if you have it there (assuming it got recently added as new)
 
But when I retrieve the companies, how do I link these to that file? Or does each company have a .txt file with specific brands?
 
no .txt files please. bad practice.
 
9:26 AM
@AndyK 0 risk, it are just brands as to specify "Jaguar/Rover specialist"
 
@MwBakker maybe it is easier that way...
 
@AndyK hey man! o/
 
@ARr0w hey dude! long time no see! How's things?
@ARr0w +1
 
@ARr0w I understand that, but to retrieve the company and his brands it would still go through all the linked tables like company_x_brand "Ford" and company_x_brand can become huge on columns that otherwise I tempt to put in one column: "array of brands"
 
was not aware of the static class thingy
 
9:27 AM
@AndyK job, son & wife. life revolves around these things now.
 
@ARr0w congrats!
 
@AndyK thanks.. life has changed alot and still changing.
 
@ARr0w with a new born, things are suddenly ... intense.
 
indeed.
 
So in short ARr0w, you still suggest a table with company_x_brand?
company_X_brand: "Mark's Workshop", "Rover"
company_X_brand: "Mark's Workshop", "Jaguar"
company_X_brand: "Mark's Workshop", "Mini"
 
9:29 AM
@MwBakker servers are called servers because they are assumed to handle the "request load"

you can't make your server be free of requests.
that is why servers are highly equipped
you can just lessen the number of requests
 
allright
 
by getting the data that is you know won't change in a while
in some static list of objects.
 
but looking at my comment above, is that the best solution?

company_X_brand: "Mark's Workshop", "Rover"

for example
 
e.g.

public static class Common{
public static List<Brand> brands;
}
public class Brand{
public string BrandName {get;set;}
}
just name the table Brand.
when the database schema is telling it self it is some automobile db
it is assumed the brands will be of companies.
write code as if you are writing an essay (seriously)

in a way that if another programmer reads it. It should be like he is reading a text book.
in that manner, you won't have to add extra commented lines
 
"it is assumed the brands will be of companies." yes but then how do I link the specific brand to that company?
I'll visualize what I mean, one moment
 
9:38 AM
junction table
companyId, brandId
 
So this is the best solution
Instead of
 
ah
copmany_x_brand is your junction table.
yes. well, just name it programmer friendly.
company_x_brand seems fair enough
 
This is option two
 
no. NEVER!
2
 
haha ok clear
thank you guys for your help
 
9:43 AM
i'd prefer a prefix for junction tables.

such as

junc_company_brand
so that later when i have bunch of junction tables.
i will able to search it out
 
true, could be a lot more readable friendly
It's FireStore after all, so I need clearence in naming for sure or I'll be lost in the documents
 
for e.g. in mssql

select * from information.schema.tables where table_name like 'junc%'
this way i'll get all the junc tables and now i can pick what i believe i need to work with
 
yep, noice
 
super late to the discussion
but u should definitely use junction tables
@AndyK You still working at the uni?
 
10:01 AM
@Tomm it will resume in September, it was a short time contract for a few months
 
aaah, what are you doing now then?
 
10:29 AM
@Tomm working on a python dev position and doing a lot of Kube and Docker
 
oo nice
 
 
3 hours later…
1:13 PM
@Tomm not bad indeed but the company is sinking litterally, they lost 30% of their turnover. Time to move away from that sinking ship.
 
Holy shit thats tragic
 
@Tomm poor management, very.
 

« first day (3276 days earlier)      last day (1042 days later) »