originaldesigndecisions.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. .. _original-design-decisions-chapter:
  2. ===========================
  3. Original Design Decisions
  4. ===========================
  5. .. contents:: Sections
  6. :local:
  7. This chapter talks a bit about design decisions.
  8. Note: This is an outdated document. It's more or less the historical
  9. reasons for a lot of things. That doesn't mean these decisions have
  10. stayed the same or we haven't changed our minds on some things!
  11. Why GNU MediaGoblin?
  12. ====================
  13. Chris and Will on "Why GNU MediaGoblin":
  14. Chris came up with the name MediaGoblin. The name is pretty fun.
  15. It merges the idea that this is a Media hosting project with
  16. Goblin which sort of sounds like gobbling. Here's a piece of
  17. software that gobbles up your media for all to see.
  18. `According to Wikipedia <http://en.wikipedia.org/wiki/Goblin>`_, a
  19. goblin is:
  20. a legendary evil or mischievous illiterate creature, described
  21. as grotesquely evil or evil-like phantom
  22. So are we evil? No. Are we mischievous or illiterate? Not
  23. really. So what kind of goblin are we thinking about? We're
  24. thinking about these goblins:
  25. .. figure:: ../_static/goblin.png
  26. :alt: Cute goblin with a beret.
  27. *Figure 1: Cute goblin with a beret. llustrated by Chris
  28. Webber*
  29. .. figure:: ../_static/snugglygoblin.png
  30. :scale: 50%
  31. :alt: Snuggly goblin with a beret.
  32. *Figure 2: Snuggly goblin. Illustrated by Karen Rustad*
  33. Those are pretty cute goblins. Those are the kinds of goblins
  34. we're thinking about.
  35. Chris started doing work on the project after thinking about it
  36. for a year. Then, after talking with Matt and Rob, it became an
  37. official GNU project. Thus we now call it GNU MediaGoblin.
  38. That's a lot of letters, though, so in the interest of brevity and
  39. facilitating easier casual conversation and balancing that with
  40. what's important to us, we have the following rules:
  41. 1. "GNU MediaGoblin" is the name we're going to use in all official
  42. capacities: web site, documentation, press releases, ...
  43. 2. In casual conversation, it's ok to use more casual names.
  44. 3. If you're writing about the project, we ask that you call it GNU
  45. MediaGoblin.
  46. 4. If you don't like the name, we kindly ask you to take a deep
  47. breath, think a happy thought about cute little goblins playing
  48. on a playground and taking cute pictures of themselves, and let
  49. it go. (Will added this one.)
  50. Why Python
  51. ==========
  52. Chris Webber on "Why Python":
  53. Because I know Python, love Python, am capable of actually making
  54. this thing happen in Python (I've worked on a lot of large free
  55. software web applications before in Python, including `Miro
  56. Community`_, the `Miro Guide`_, a large portion of `Creative
  57. Commons`_, and a whole bunch of things while working at `Imaginary
  58. Landscape`_). Me starting a project like this makes sense if it's
  59. done in Python.
  60. You might say that PHP is way more deployable, that Rails has way
  61. more cool developers riding around on fixie bikes---and all of
  62. those things are true. But I know Python, like Python, and think
  63. that Python is pretty great. I do think that deployment in Python
  64. is not as good as with PHP, but I think the days of shared hosting
  65. are (thankfully) coming to an end, and will probably be replaced
  66. by cheap virtual machines spun up on the fly for people who want
  67. that sort of stuff, and Python will be a huge part of that future,
  68. maybe even more than PHP will. The deployment tools are getting
  69. better. Maybe we can use something like Silver Lining. Maybe we
  70. can just distribute as ``.debs`` or ``.rpms``. We'll figure it
  71. out when we get there.
  72. Regardless, if I'm starting this project, which I am, it's gonna
  73. be in Python.
  74. .. _Miro Community: http://mirocommunity.org/
  75. .. _Miro Guide: http://miroguide.org/
  76. .. _Creative Commons: http://creativecommons.org/
  77. .. _Imaginary Landscape: http://www.imagescape.com/
  78. Why WSGI Minimalism
  79. ===================
  80. Chris Webber on "Why WSGI Minimalism":
  81. If you notice in the technology list I list a lot of components
  82. that are very "django-like", but not actually `Django`_
  83. components. What can I say, I really like a lot of the ideas in
  84. Django! Which leads to the question: why not just use Django?
  85. While I really like Django's ideas and a lot of its components, I
  86. also feel that most of the best ideas in Django I want have been
  87. implemented as good or even better outside of Django. I could
  88. just use Django and replace the templating system with Jinja2, and
  89. the form system with wtforms, and the database with MongoDB and
  90. MongoKit, but at that point, how much of Django is really left?
  91. I also am sometimes saddened and irritated by how coupled all of
  92. Django's components are. Loosely coupled yes, but still coupled.
  93. WSGI has done a good job of providing a base layer for running
  94. applications on and if you know how to do it yourself [1]_, it's
  95. not hard or many lines of code at all to bind them together
  96. without any framework at all (not even say `Pylons`_, `Pyramid`_
  97. or `Flask`_ which I think are still great projects, especially for
  98. people who want this sort of thing but have no idea how to get
  99. started). And even at this already really early stage of writing
  100. MediaGoblin, that glue work is mostly done.
  101. Not to say I don't think Django isn't great for a lot of things.
  102. For a lot of stuff, it's still the best, but not for MediaGoblin,
  103. I think.
  104. One thing that Django does super well though is documentation. It
  105. still has some faults, but even with those considered I can hardly
  106. think of any other project in Python that has as nice of
  107. documentation as Django. It may be worth learning some lessons on
  108. documentation from Django [2]_, on that note.
  109. I'd really like to have a good, thorough hacking-howto and
  110. deployment-howto, especially in the former making some notes on
  111. how to make it easier for Django hackers to get started.
  112. .. _Django: http://www.djangoproject.com/
  113. .. _Pylons: http://pylonshq.com/
  114. .. _Pyramid: http://docs.pylonsproject.org/projects/pyramid/dev/
  115. .. _Flask: http://flask.pocoo.org/
  116. .. [1] http://pythonpaste.org/webob/do-it-yourself.html
  117. .. [2] http://pycon.blip.tv/file/4881071/
  118. Why MongoDB
  119. ===========
  120. (Note: We don't use MongoDB anymore. This is the original rationale,
  121. however.)
  122. Chris Webber on "Why MongoDB":
  123. In case you were wondering, I am not a NOSQL fanboy, I do not go
  124. around telling people that MongoDB is web scale. Actually my
  125. choice for MongoDB isn't scalability, though scaling up really
  126. nicely is a pretty good feature and sets us up well in case large
  127. volume sites eventually do use MediaGoblin. But there's another
  128. side of scalability, and that's scaling down, which is important
  129. for federation, maybe even more important than scaling up in an
  130. ideal universe where everyone ran servers out of their own
  131. housing. As a memory-mapped database, MongoDB is pretty hungry,
  132. so actually I spent a lot of time debating whether the inability
  133. to scale down as nicely as something like SQL has with sqlite
  134. meant that it was out.
  135. But I decided in the end that I really want MongoDB, not for
  136. scalability, but for flexibility. Schema evolution pains in SQL
  137. are almost enough reason for me to want MongoDB, but not quite.
  138. The real reason is because I want the ability to eventually handle
  139. multiple media types through MediaGoblin, and also allow for
  140. plugins, without the rigidity of tables making that difficult. In
  141. other words, something like::
  142. {"title": "Me talking until you are bored",
  143. "description": "blah blah blah",
  144. "media_type": "audio",
  145. "media_data": {
  146. "length": "2:30",
  147. "codec": "OGG Vorbis"},
  148. "plugin_data": {
  149. "licensing": {
  150. "license": "http://creativecommons.org/licenses/by-sa/3.0/"}}}
  151. Being able to just dump media-specific information in a media_data
  152. hashtable is pretty great, and even better is having a plugin
  153. system where you can just let plugins have their own entire
  154. key-value space cleanly inside the document that doesn't interfere
  155. with anyone else's stuff. If we were to let plugins to deposit
  156. their own information inside the database, either we'd let plugins
  157. create their own tables which makes SQL migrations even harder
  158. than they already are, or we'd probably end up creating a table
  159. with a column for key, a column for value, and a column for type
  160. in one huge table called "plugin_data" or something similar. (Yo
  161. dawg, I heard you liked plugins, so I put a database in your
  162. database so you can query while you query.) Gross.
  163. I also don't want things to be too loose so that we forget or lose
  164. the structure of things, and that's one reason why I want to use
  165. MongoKit, because we can cleanly define a much structure as we
  166. want and verify that documents match that structure generally
  167. without adding too much bloat or overhead (MongoKit is a pretty
  168. lightweight wrapper and doesn't inject extra MongoKit-specific
  169. stuff into the database, which is nice and nicer than many other
  170. ORMs in that way).
  171. Why Sphinx for documentation
  172. ============================
  173. Will Kahn-Greene on "Why Sphinx":
  174. `Sphinx`_ is a fantastic tool for organizing documentation for a
  175. Python-based project that makes it pretty easy to write docs that
  176. are readable in source form and can be "compiled" into HTML, LaTeX
  177. and other formats.
  178. There are other doc systems out there, but given that GNU
  179. MediaGoblin is being written in Python and I've done a ton of
  180. documentation using Sphinx, it makes sense to use Sphinx for now.
  181. .. _Sphinx: http://sphinx.pocoo.org/
  182. Why AGPLv3 and CC0?
  183. ===================
  184. Chris, Brett, Will, Rob, Matt, et al curated into a story where
  185. everyone is the hero by Will on "Why AGPLv3 and CC0":
  186. The `AGPL v3`_ preserves the freedoms guaranteed by the GPL v3 in
  187. the context of software as a service. Using this license ensures
  188. that users of the service have the ability to examine the source,
  189. deploy their own instance, and implement their own version. This
  190. is really important to us and a core mission component of this
  191. project. Thus we decided that the software parts should be under
  192. this license.
  193. However, the project is made up of more than just software:
  194. there's CSS, images, and other output-related things. We wanted
  195. the templates/images/css side of the project all permissive and
  196. permissive in the same absolutely permissive way. We're waiving
  197. our copyrights to non-software things under the CC0 waiver.
  198. That brings us to the templates where there's some code and some
  199. output. The template engine we're using is called Jinja2. It
  200. mixes HTML markup with Python code to render the output of the
  201. software. We decided the templates are part of the output of the
  202. software and not the software itself. We wanted the output of the
  203. software to be licensed in a hassle-free way so that when someone
  204. deploys their own GNU MediaGoblin instance with their own
  205. templates, they don't have to deal with the copyleft aspects of
  206. the AGPLv3 and we'd be fine with that because the changes they're
  207. making are identity-related. So at first we decided to waive our
  208. copyrights to the templates with a CC0 waiver and then add an
  209. exception to the AGPLv3 for the software such that the templates
  210. can make calls into the software and yet be a separately licensed
  211. work. However, Brett brought up the question of whether this
  212. allows some unscrupulous person to make changes to the software
  213. through the templates in such a way that they're not bound by the
  214. AGPLv3: i.e. a loophole. We thought about this loophole and
  215. between this and the extra legalese involved in the exception to
  216. the AGPLv3, we decided that it's just way simpler if the templates
  217. were also licensed under the AGPLv3.
  218. Then we have the licensing for the documentation. Given that the
  219. documentation is tied to the software content-wise, we don't feel
  220. like we have to worry about ensuring freedom of the documentation
  221. or worry about attribution concerns. Thus we're waiving our
  222. copyrights to the documentation under CC0 as well.
  223. Lastly, we have branding. This covers logos and other things that
  224. are distinctive to GNU MediaGoblin that we feel represents this
  225. project. Since we don't currently have any branding, this is an
  226. open issue, but we're thinking we'll go with a CC BY-SA license.
  227. By licensing in this way, we make sure that users of the software
  228. receive the freedoms that the AGPLv3 ensures regardless of what
  229. fate befalls this project.
  230. So to summarize:
  231. * software (Python, JavaScript, HTML templates): licensed
  232. under AGPLv3
  233. * non-software things (CSS, images, video): copyrights waived
  234. under CC0 because this is output of the software
  235. * documentation: copyrights waived under CC0 because it's not part
  236. of the software
  237. * branding assets: we're kicking this can down the road, but
  238. probably CC BY-SA
  239. This is all codified in the ``COPYING`` file.
  240. .. _AGPL v3: http://www.gnu.org/licenses/agpl.html
  241. .. _CC0 v1: http://creativecommons.org/publicdomain/zero/1.0/
  242. Why (non-mandatory) copyright assignment?
  243. =========================================
  244. Chris Webber on "Why copyright assignment?":
  245. GNU MediaGoblin is a GNU project with non-mandatory but heavily
  246. encouraged copyright assignment to the FSF. Most, if not all, of
  247. the core contributors to GNU MediaGoblin will have done a
  248. copyright assignment, but unlike some other GNU projects, it isn't
  249. required here. We think this is the best choice for GNU
  250. MediaGoblin: it ensures that the Free Software Foundation may
  251. protect the software by enforcing the AGPL if the FSF sees fit,
  252. but it also means that we can immediately merge in changes from a
  253. new contributor. It also means that some significant non-FSF
  254. contributors might also be able to enforce the AGPL if seen fit.
  255. Again, assignment is not mandatory, but it is heavily encouraged,
  256. even incentivized: significant contributors who do a copyright
  257. assignment to the FSF are eligible to have a unique goblin drawing
  258. produced for them by the project's main founder, Christopher Allan
  259. Webber. See `the wiki <http://wiki.mediagoblin.org/>`_ for details.