clarity on ERD diagram - entity-relationship

Please I am in a confused state.
I do not know the difference between this two images as which one is the ERD diagram.
I have gone through google and I have met the two images.
Please I would like to know which one of the two images is actually the real ERD diagram.
erd image
erd image2.
Please I am not able to put the image directly yet.
This is even from a question in stackoverflow.com
ER Diagram - Showing Deliveries to Office and to its Branches
Or can they be used interchangeably?

Related

Connecting two Entity Relationship Diagrams

I am having a huge project and the entity relationship diagram is looking pretty crowded. So I was thinking about to separate the big entity relationship diagram in two or maybe more diagrams.
But I can't find a proper way to do that and still have like an component diagram which I can connect the diagrams somehow ...
At this moment I am not even sure this is possible..
So if not is there at least a way to donĀ“t show the bubble-attributes in your diagram?

How to think about models and relationships in more complex Rails applications?

I've been learning Ruby on Rails for quite some time now and have built several toy applications. I've taken many classes/courses (i.e., Hartl, Code School, Udemy, etc.). Now I'm working on a pet project that is fairly complex - many models and relationships.
Here's my question: How do I go about thinking about a complex application in terms of models and relationships? It seems to me there should be some visual way to model all of this, but I haven't seen any discussion of such modeling in any of the classes I've taken. Sure, there's the very simple diagrams in the Rails Guides, but how do I extend this to something more complex? Or, am I making this too complicated? Do I just start coding models and relationships and see where it takes me? It seems this ad hoc approach could easily paint me into a corner where I'll have to start over from scratch if I paint myself into a corner, so to speak.
Are there tools or blog posts that can help me?
(Note: I've also posted this question at Reddit.Com/r/Rails at https://www.reddit.com/r/rails/comments/7c9zbf/how_to_think_about_rails_web_application/)
It sounds like what you're after is a schema designer. I'll link one at the bottom of this post. A schema designer will allow you to visualize all the relationships in your application, and see how one model connects to another. They're really helpful in writing complex DB queries. I've attached an example of a fairly simple design just to give you an idea what they do.You can also add all the columns a model has in the design, I just usually use it more for relationships.
http://ondras.zarovi.cz/sql/demo/
Purely based on my experience/opinion...
You'll end up changing your database design a couple of times as you build your app.
I would start with a whiteboard, then consider using a schema designer as #aram mentioned.
After you see the big picture, just start with the relationships that what you need for today's features. You can keep referring to the original design, so you can see the bigger picture, but you don't want to overbloat your architecture before you need to because it will change.
After you write some code and build those relationships, you can spot check yourself using the rails-erd gem to programmatically generate your app's schema.

Simple social network design flaw with graph database

I was looking at graph databases and Neo4j. As suggested, I tried to draw a simple social networking graph on white paper and after a few sketches I stucked at some similar points.
At first I designed a social network where "user"s can "like" "post"s.
(u1:User)-[:LIKED]->(p:Post)<-[:POSTED]-(u2:User)
Now I want to notify user2 about the like action and draw this on the white paper.
(u1:User)-[:LIKED]->(p:Post)<-[:POSTED]-(u2:User)
| ^
|__________[:NOTIFY]_________|
I am not sure if it is clear but I just drew a relationship between a node and another relationship which is not possible for graph databases, at least for Neo4j. So I decided, a Like should be a node instead of a relationship. Then my graph turned into this.
(u1:User)-[:CREATAD]->(l:Like)-[:BELONGS_TO]->(p:Post)<-[:POSTED]-(u2:User)
| ^
|__________________[:NOTIFY]________________|
Now everything is OK. Then I added Comments feature to the system as a relationship but when notifications involved, again it turned into a node. And same happened when I added "Liking comments" feature, "Likes to Comments" first seemed they are relationships but once again they turned into nodes when notifications involved.
In general, at some point I find myself drawing a relationship between a node and another relationship. My solution to that feels like I am turning entities, which naturally look like relationships, into nodes. And this makes me think of I have some problems with deciding what should be a node and what should be a relationship.
So my question is, does anyone else other than me fall into this "relationship between a node and another relationship" issue and if so how do you solve that?
It all depends on your use-cases, in many cases a simple relationship is good enough but if you want to do more with that entity or fact you turn it into a node, oftentimes it turns out that it is an actually quite important concept in the domain.
In our data modeling class there is a specific section on this and also in the "Graph Databases" book it is discussed in detail (you can get the free PDF here).
Sometimes it makes sense to keep the original relationship around for a fast shortcut crossing over that intermediate node if you don't need that detail.

Carrierwave: how to handle multiple uploads of the same type

currently I am having an Article model with one carrierwave uploader, requirements have changed and every Article should have n images attached.
What is the best (and most simple) way to achieve this? Right now, all I can think of is creating an Image entity and have this reference the uploader and let have every Article n Images. Sounds like a lot of work and would break all current images, so I would not favor this.
It might be better if you do split out the image uploading requirements into its own model. Your Article model has already changed the requirements and you might have other models needing similar functionality later on.
From the software design point of view, having an Image model that deals with uploading and relating that to an Article model is a more maintainable way.

Where can I find a real dataset anywhere online that I could try doing a data warehouse cube with?

I am studying data warehouses and I have to do one final project for my studies.
I am thinking about doing a cube for a data warehouse. Where can I find a real dataset anywhere online that I could try doing a cube with?
You can refer to this page to see how to convert a part of the Northwind database to a star schema for building cubes: Northwind Star Schema.
Here's an example on Adventure Works - of course, it's prebuilt SSAS, but I guess you could look at the underlying AventureWorks DB and do the dimensional modeling yourself.
I think doing a DW on an existing popular dataset like Northwind or AdventureWorks is probably not a great idea, because so many people have done them. Even StackOverflow has had data mining done, but perhaps it would be a good candidate - I'm not sure what Brent's work actually comprised.
So if you are looking to do an original project, you might need to look further afield, if only to distinguish your work from previous work.

Resources