Ayende @ Rahien

It's a girl

Looking at the RavenDB structure

Originally posted at 3/15/2011

I am trying to explain how RavenDB is structured, and we finally generated the following diagram:

image

I was actually surprised, because I don’t generally think about it this way, but having the diagram in front of us was really helpful in explain where everything goes.

And, of course, the inevitable nitpick: OMG it takes a loooong time to layout the graph.

Comments

Yaron Wittenstein
03/25/2011 11:50 AM by
Yaron Wittenstein

What software did you use to show the dependencies graph?

Colin
03/25/2011 12:05 PM by
Colin

That looks like the architecture feature in VS2010.

njy
03/25/2011 12:06 PM by
njy

@Yaron: the software used is called Visual Studio 2010, you've probably hear about that.

Specifically, the version is Ultimate, wich is the only version w/ Architecture Explorer.

njy
03/25/2011 12:08 PM by
njy

@Yaron: ooops, missing smiley face :-)

ctx
03/25/2011 01:19 PM by
ctx

Nice looking graph.

Does the arrows indicate dependencies? So Raven.Storage.Managed.Dll depends on Raven.Munin.dll?

Vadim Kantorov
03/25/2011 05:03 PM by
Vadim Kantorov

He-he. My friend in MS Research actually works on that graph drawing piece :) If you wish, I may connect you both.

Daniel Hoelbling
03/26/2011 01:15 AM by
Daniel Hoelbling

Why didn't you just use ndepend?

Besides a bunch of great features tha are handy when looking at other people's code, it's dependency graph is really nice..

Ayende Rahien
03/28/2011 05:50 PM by
Ayende Rahien

I have absolutely no idea...

Esther Fan
04/07/2011 09:55 PM by
Esther Fan

The number on each shape how many items are contained by that shape. Here's more info about how to use dependency graphs to help you understand the organization of the code:

YouTube: http://www.youtube.com/watch?v=bJpPusOORVo

Chris Lovett
04/12/2011 12:33 AM by
Chris Lovett

"OMG it takes a loooong time to layout the graph"

Note that most of the time is spent analyzing the assemblies to find all the dependencies that are then rolled up on the graph. The final "layout" of the graph is pretty quick, as you can see when you change the layout to "Left To Right" which I think you will find is almost instant on this sized graph even though it actually contains a rollup of 21861 nodes and 63982 links.

If you only care about assembly dependencies you can use the "Custom" dependency graph dialog to select only "Assemblies" and not "Namespaces, Types and MEthods". This graph will be much smaller and faster with only 15 nodes and 30 links, but at the cost of not being able to expand and drill down to see any details.

Ayende Rahien
04/12/2011 04:21 AM by
Ayende Rahien

Chris,

Remove an item from the graph (after it was already render), for example, if you don't care for a specific assembly.

It takes minutes to re-draw, on a fairly powerful machine

Chris Lovett
04/25/2011 08:13 PM by
Chris Lovett

Ok, yes, you do have to watch out for graphs with this many hidden nodes and links. You can use the the "Custom..." dialog on the Generate Dependency Graph menu to ask for "Assemblies" only and not namespaces, classes & methods, then the graph will be vastly smaller and much easier to deal with.

PS: the number on the top left of the collapsed group node is a simple count of the number of nodes inside it. So it represents a namespace, then it is usually the number of classes inside, or if it represents a Class then it's the number of methods inside, etc. This helps give an idea of hidden complexity in your system. If the number is over 100 you might not want to think twice before expand that group, etc.

Comments have been closed on this topic.