2

I am just starting with Meteor creating some test/practice apps. After I have created the app and run it, the .meteor folder size baloons to 500 MB. Each practice app adds 500 MB or so to my working folder.

I am not playing with any huge data sets on anything, my database will be less than 10 MB.

As I sync my work folder with my laptop, it is a major pain to back it up. How can I reduce the size of default mongodb while creating a practice app so that backing it up or folder sync

Also even when I copy the whole app folder to the new location, It does not run, likely because the database is stored somewhere else.

Can I save the database to the same folder as the app, so that just copying the folder over will enable me to continue working on the laptop as well?

Sorry if the question is too noobish.

Thanks for your time.

meteor reset >>> deletes my database. I want to be able to preserve it.

barryjs
  • 43
  • 5
  • I think the meteors database is dynamically created. If you want to copy your project to your laptop just copie everything INSIDE your project directory and not the whole project directory, then create project on your laptop 'meteor create myProject' and put everything in that newly created folder. There is also meteor's bundle option but i didnt look into it much. – yoK0 Oct 08 '14 at 07:21
  • I have tried it, It did not work for me. – barryjs Oct 09 '14 at 03:12

2 Answers2

1

Yes, this can be a pain and is unavoidable by default at present. However, a couple of ideas that might be useful:

  1. If you have multiple meteor apps, it's possible to use the same DB for each, as per @elfoslav: link. However, note that you have to supply the env variable every time or create a shell script for when you start meteor, otherwise it'll create a new db for you if you run meteor on its own just once!
  2. If it's just portability of the app you're concerned about, get comfortable with mongodump and mongorestore, which will yield bson files containing just your database contents (i.e. about 10mb) which are pretty easy to insert back into another instance of mongoDB, so that you only have to copy these backwards and forwards. Here is a guide to doing this with your Meteor DB, and here is a great gist from @olizilla.
Community
  • 1
  • 1
richsilv
  • 7,993
  • 1
  • 23
  • 29
0

Have you tried below mongoDB configuration options to limit the space it occupies?

storage.smallFiles

Type: boolean Default: False

Sets MongoDB to use a smaller default file size. The storage.smallFiles option reduces the initial size for data files and limits the maximum size to 512 megabytes. storage.smallFiles also reduces the size of each journal file from 1 gigabyte to 128 megabytes. Use storage.smallFiles if you have a large number of databases that each holds a small quantity of data.

storage.journal.enabled

Type: boolean Default: true on 64-bit systems, false on 32-bit systems

Enables the durability journal to ensure data files remain valid and recoverable. This option applies only when you specify the --dbpath option. The mongod enables journaling by default on 64-bit builds of versions after 2.0.

Refer to: http://docs.mongodb.org/manual/reference/configuration-options/

Frank Fang
  • 151
  • 2
  • 7
  • for beginners, it'd be helpful information to include where there configuration options should be added to the meteor app – max pleaner Mar 05 '16 at 22:12