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
Search - "er diagram"
-
Arts and crafts: developer version.
Context: spent all day making an ER diagram from an awful SQL query I was handed. Got sick of asking for it from the contractor who made the DB.
Yes, that's one query.25 -
If anyone has been keeping up with my data warehouse from hell stories, we're reaching the climax. Today I reached my breaking point and wrote a strongly worder email about the situation. I detailed 3 separate cases of violated referential integrity (this warehouse has no constraints) and a field pulling from THE WRONG FLIPPING TABLE. Each instance was detailed with the lying ER diagram, highlighted the violating key pairs, the dangers they posed, and how to fix it. Note that this is a financial document; a financial document with nondeterministic behavior because the previous contractors' laziness. I feel like the flipping harbinger of doom with a cardboard sign saying "the end is near" and keep having to self-validate that if I was to change anything about this code, **financial numbers would change**, names would swap, description codes would change, and because they're edge cases in a giant dataset, they'll be hard to find. My email included SQL queries returning values where integrity is violated 15+ times. There's legacy data just shoved in ignoring all constraints. There are misspellings where a new one was made instead of updating, leaving the pk the same.
Now I'd just put sorting and other algos, but the data is processed by a crystal report. It has no debugger. No analysis tools. 11 subreports. The thing takes an hour to run and 77k queries to the oracle backend. It's one of the most disgusting infrastructures I've ever seen. There's no other solution to this but to either move to a general programming language or get the contractor to fix the data warehouse. I feel like I've gotten nowhere trying to debug this for 2 months. Now that I've reached what's probably the root issue, the office beaucracy is resisting the idea of throwing out the fire hazard and keeping the good parts. The upper management wants to just install sprinklers, and I'm losing it. -
Cannot believe I am paying for a course with a lecturer that doesn't even teach the students what a foreign key is, or the concept of a join table to breakdown many-to-many relationships in a database. Literally telling me "If thats how you interpreted it, it's ok to add that in, but you dont have to." In relation to adding a new entity into the ER Diagram as a join table.
It isn't up for interpretation, you are literally joining tables based on foreign keys that will create duplication and make no sense. I mean, you are teaching people who have likely never worked with DB's before... you cannot teach them this. 🤦♀️1 -
University wants a final year major project which should give an output as a research paper published in some conference or journal. All seems great. Department rejected all web app related projects because it's too generic.. Still makes sense..
And then suddenly, department asks where are customer requirements, where is ER diagram, where are Selenium tests??????
And they still expect a research paper to be published....
Why do they don't understand the difference between software development and research works.. !!!!!!1 -
Ok now I'm gonna tell you about my "Databases 2" exam. This is gonna be long.
I'd like to know if DB designers actually have this workflow. I'm gonna "challenge" the reader, but I'm not playing smartass. The mistakes I point out here are MY mistakes.
So, in my uni there's this course, "Databases 2" ("Databases 1" is relational algebra and theoretical stuff), which consist in one exercise: design a SQL database.
We get the description of a system. Almost a two pages pdf. Of course it could be anything. Here I'm going to pretend the project is a YouTube clone (it's one of the practice exercises).
We start designing a ER diagram that describes the system. It must be fucking accurate: e.g. if we describe a "view" as a relationship between the entities User and Video, it MUST have at least another attribute, e.g. the datetime, even if the description doesn't say it. The official reason?
"The ER relationship describes a set of couples. You can not have two elements equal, thus if you don't put any attribute, it means that any user could watch a video only once. So you must put at least something else."
Do you get my point? In this phase we're not even talking about a "database", this is an analysis phase.
Then we describe the type dictionary. So far so good, we just have to specify the type of any attribute.
And now... Constraints.
Oh my god the constraints. We have to describe every fucking constraint of our system. In FIRST ORDER LOGIC. Every entity is a set, and Entity(e) means that an element e belongs to the set Entity. "A user must leave a feedback after he saw a video" becomes like
For all u,v,dv,df,f ( User(u) and Video(v) and View(u, v, dv) and feedback(u, v, f) ) ---> dv < df
provided that dv and df are the datetimes of the view and the feedback creation (it is clear in the exercise, here seems kinda cryptic)
Of course only some of the constraints are explicitly described. This one, for example, was not in the text. If you fail to mention any "hidden" constraint, you lose a lot of points. Same thing if you not describe it correctly.
Now it's time for use cases.
You start with the usual stickman diagram. So far so good.
Then you have to describe their main functions.
In first order logic. Yes.
So, if you got the point, you may think that the following is correct to get "the average amount of feedback values on a single video" (1 to 5, like the old YT).
(let's say that feedback is a relationship with attribute between User and Video
getAv(Video v): int
Let be F = { va | feedback(v, u, va) } for any User u
Let av = (sum forall f in F) / | F |
return av
But nope, there's an error here. Can you spot it (I didn't)?
F is a set. Sets do not have duplicates! So, the F set will lose some feedback values! I can not define that as a simple set!
It has to be a set of couples, like (v, u), where v is the value and u the user; this way we can have duplicate feedback values in our set.
This concludes the analysis phase. Now, the design.
Well we just refactor everything we have done until now. Is-a relations become relationships, many-to-many relationships get an "association entity" between them, nothing new.
We write down on paper every SQL statement to build any table, entity or not. We write down every possible primary key or foreign key. The constraint that are not natively satisfied by SQL and/or foreign keys become triggers, and so on.
This exam is considered the true nightmare at our department. I just love it.
Now my question is, do actually DB designers follow this workflow? Or is this just a bloody hard training in Pai Mei style?6 -
If you have striggled a lot to find good diagram makers/editor. Here is the one.
draw.io is free online diagram software for making flowcharts, process diagrams, org charts, UML, ER and network diagrams.
Try it. Its open source. Even the code is open source, you can get the war and run it in you tomcat offline...
I am listing few type of diagram you can draw are
1. ER Diagram
2. UML Diagram
3. Business process workflows
4. Bootstrap components for mock screens
5. Wireframes
6. Floor plan
7. Network diagram
Many more...
Explore!!!
https://www.draw.io -
Just finished making an ER diagram for the 5th time now.
It was less painful this time. (Thanks draw.io)
(About the 4th ER diagram - le professor says "It looks like a flow chart, that's not right", but it's clearly not?)
I'll have to submit the draft tomorrow to the professor, I just hope that he green lights it so I could finalize the project report.
I hate making ER diagrams now. -
How do I make an ER diagram ?
I tried doing it in PowerPoint but it's too large to fit on one slide.
Online tools are no help. (At least the ones I tried)
It's such a pain.8 -
As a student, I really do understand the need for the diagrams made for a system, diagrams such as
ER Diagram
Use case Diagram
Class Diagram
etc
Like it's literally pointless...6 -
If i have 4 types of user in a system, is it better to separate them each individually into their own models:
- UserA
- UserB
- UserC
- UserD
or should i group them all into 1 model:
- User
And then add an attribute Role in order to distinguish each one?
What is the proper way?
Entities:
- admin
- staff
- seller
- buyer
How would you structure these as ER diagram?7 -
had a uni exam in databases (just closely didn't make it😒)
it didn't even have sql in it!?
questions about ER diagrams and draw a diagram, functional dependencies with given dependencies, find candidate key and what not, work on a b-tree (miserably failed😣), datalog (who the fuck cares about datalog? the least expected topic) and transaction management/serializability
whose idea was it to not include sql?? isn't it one the fundamental parts of relational databases?4 -
I cant wrap my head around designing a database system from scratch. Period.
I use ER diagrams to do it. But still i can't figure this piece of shit out.
It usually goes in these steps:
1) i design a very simple minimal system, turns out it works but HELL NO how unsalable it is. Literally its so statically built that i have to redesign the whole infrastructure and models from scratch
2) i redesign from scratch but this time i overengineer it. Overcomplex as fuck. So complex i get lost easily and have to redesign the whole shit all over again this time copying others similar infrastructure with help of chatgpt
3) chatgpt of course fucks everything up even more to the point that my shit can't compile anymore. Fuck this shit
I think i lack the correct way of thinking and approaching this. College has taught me bullshit and confused me even more which is why im so fucking lost. Can someone explain me How to think in the correct mentality when designing an ER database system from scratch.
How do i properly design a scalable database infrastructure as ER diagram for a subscription and chatting models, similar to onlyfans infrastructure?9