13

I'm trying to display all of my corporate database instances and their relationship to each other, so to speak the database links. I found the geometry shape cylinder using TikZ \usetikzlibrary{shapes.geometric}, but I'm new to the whole TikZ stuff and it doesn't worked out that well so I thought maybe you could help me getting something like the following figure:

enter image description here

There will be a ton of instances and arrows, but I hope that you guys could give me a start so that I could do the rest on my own.

Chris.V
  • 721

1 Answers1

19

A very basic approach could look like this.

\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,shapes.geometric}

\begin{document}
  \begin{tikzpicture}[
    >=stealth,
    node distance=3cm,
    database/.style={
      cylinder,
      cylinder uses custom fill,
      cylinder body fill=yellow!50,
      cylinder end fill=yellow!50,
      shape border rotate=90,
      aspect=0.25,
      draw
    }
  ]
    \node[database] (db1) at (0,0) {DB1};
    \node[database,right of=db1] (db2) {DB2};
    \node[database,below of=db1] (db3) {DB3};

    \draw[->,blue!50] (db1) --  node[black,midway,above,sloped,font=\scriptsize]{Link: Name} node[black,midway,below,sloped,font=\scriptsize]{Owner: Name} (db3);
    \draw[->,blue!50] (db1) -- ++(0,1) -- ($(db2)+(0,1)$) node[black,midway,above,font=\scriptsize]{Link: Name} node[black, midway,below,font=\scriptsize]{Owner: Name} -- (db2) ;
  \end{tikzpicture}
\end{document}

Can for sure be improved here and there.


enter image description here

  • This is a really good starting point for me with which I hopefully can complete my figure. Is there a possibility to do a multiline text inside the cylinder? – Chris.V Jul 13 '13 at 12:00
  • @Chris.V Use the key text width=4cm or the desired amount. If the text is larger, it will be broken in lines. And you can use \par or empty lines inside to start new paragraphs anyway. – JLDiaz Jul 13 '13 at 12:15
  • 2
    Perhaps the answers to this question can be helpful. – Thorsten Donig Jul 13 '13 at 12:34