What is the relationship between Unity, Gnome, Gnome 3, Compiz, Metacity, and LightDM?

You only need to know 4 terms:

  • Display manager
  • Window Manager
  • Graphical User Interfaces (GUI)
  • Desktop Environments

Display manager

Examples are LightDM, GDM, KDM, and LXDM. They normally have display manager somewhere in their names. These start the X server at boot and provide a login screen. They often let you select a window manager and/or desktop environment as part of logging in.

Window Manager

Compiz, Metacity, Mutter, W9dk, fluxbox are window managers. There are too many to list. If you want you can check all the packages that provide x-window-manager to get an incomplete list of the window managers in Ubuntu. These only are responsible of drawing the application borders, managing the position of the windows, themes and decorations.

Grapical User Interfaces (GUI)

Anything that the user interacts with in any graphical way, with icons and representations. Window Managers, Display Manager and Graphical shells, applications, etc. falls in this category. Whatever the user is using that is represented predominantly in a graphical way is a GUI.

Desktop Environments

In the Linux world, it's referred to as a set of applications, packages, services, etc. that provides a complete and balanced ecosystem for the user. Unlike Window Manager or Desktop Manager, Desktop Environments take care of everything. From the login screen through your mail application, the network manager, text editor, the system settings, image viewer, file manager, etc. There are 4 well known Desktop Environments in Linux and Ubuntu:

  • GNOME
  • KDE Desktop Environment
  • LXDE: Lightweight X11 Desktop Environment
  • XFCE Desktop Environment

These all have a complete set of applications, settings, services, desktop/file/window managers, internet browser, etc.


So, to address your specifics concerns:

LightDM appears as a service on my installation and is a 'Window Manager'

False, LightDM is a Display Manager.

how is this related to Compiz, which is also a Window Manager but not a service?

Have nothing in common. Both have different functions. Compiz is a window composer, window decorator, a window manager.

Is Metacity also a Window Manager?

Yes.

Then there comes Gnome 3, Unity, Gnome Shell and Gnome - all of which seem to be different things.

Gnome 3, Gnome Shell and Gnome are terms used colloquially as the same thing. Unity is totally different. Unity is another shell opposed to Gnome/3/Shell. Gnome 3 Shell has been commonly called as Gnome Shell in the past, right now saying GNOME, GNOME 3 Desktop Environment or Gnome Shell carry the same meaning.