Meteor, docs and attached files

You can store files directly in MongoDB documents, however there is a limit of 16MB and the Meteor DDP protocol might not be up to the task (reference..)

There are two atmosphere packages that attempt to fill the gap:

Both are extensively documentend, with the latter one being the lighter one.

They either use the MongoDB GridFS or store files externally on S3 or the server’s file system. They both tie in with the MongoDB style of organising data, extending functionality of collections, by having special ‘file’ collections.

These ‘file’ documents can then be referenced from other documents. With these packages come API’s and systems for security, manipulation, filtering, UI helpers etc.

My eyes drooped and my mind wandered every time I tried to read through the documentation for these packages. It seemed a bit overdone, at least for my purposes.

My webstack

Partly to learn and partly because I like to be in control I wrote my own webserver. It started out as a very simple file server but now implements quite a few features. It also now cooperates to some degree with another project of mine, a simple templating engine.

I was able to implement a number of ideas across these two projects. One idea is that instead of having a build tool such as grunt the server can fullfil this role on the fly. Since you don’t really need to minify, transpile, gzip till a client browser requests the file, I thought it should be the server’s job, not some arbitrary build tool.

Another idea is that browsers implement already the best mechanism for storing resulting files, namely caches. Since we can’t always rely on a browser to cache resources, I added a LRU memory and disk cache to the server as well.

About this site

This site uses Hexo as its blogging engine. I intended to use Octopress at first but I ran into grief with syntax highlighting for code while testing. Pygments the highlighting library used seems to be unable to parse the language argument in the code block. I tried to sort it out but since I don’t know too much about Ruby and I wanted this site up within the day I switched to Hexo. It is very similar to Octopress but uses nodejs and connect with ejs for its templates instead of rails and erb. At least I should be able to fix things if they don’t work now, however it has been pretty smooth so far. Posts are written in markdown.

It might be fun to write about miscellaneous technicalities as I run into them, or I might not bother. It has certainly been useful to me to read the multitude of little articles people have been putting up on their blogs, but I don’t know if I should be adding to them. We will see…