New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move response bodies out of DB #338

Merged
merged 5 commits into from Jun 30, 2017

Conversation

Projects
None yet
2 participants
@gschier
Collaborator

gschier commented Jun 28, 2017

Why

Since Insomnia uses an in-memory database, large response bodies caused big problems.

  1. Responses needed to be kept in memory always (leading to high RAM usage)
  2. Had no way of loading response details from DB without retrieving the body too
  3. Caused NeDB to crash when response DB totaled more than NodeJS's 256MB string size limit.

Details

  • Remove Response.body and Response.encoding (old way of storage)
  • Add new Response.bodyPath field that points the the location on the FS where the body is stored
  • Compress/decompress response bodies before writing/reading to/from FS
  • Add migration to migrate old way to new way
  • Add test for migration

@gschier gschier force-pushed the performance/response-bodies-to-fs branch 6 times, most recently from 043b806 to 042cd58 Jun 28, 2017

@gschier gschier force-pushed the performance/response-bodies-to-fs branch from 042cd58 to 40f3463 Jun 29, 2017

@gschier gschier force-pushed the performance/response-bodies-to-fs branch from 456cadd to c59cb90 Jun 30, 2017

@gschier gschier force-pushed the performance/response-bodies-to-fs branch from c59cb90 to 9a04884 Jun 30, 2017

@gschier gschier merged commit de610f4 into develop Jun 30, 2017

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@gschier gschier deleted the performance/response-bodies-to-fs branch Jun 30, 2017

@JurrianFahner

This comment has been minimized.

JurrianFahner commented Jul 2, 2017

It was a nice feature... Is it possible to bring it back as a feature, so I can enable it in the preferences?
For example a checkbox somewhere with a warning?

@gschier

This comment has been minimized.

Collaborator

gschier commented Jul 2, 2017

Hi @JurrianFahner,

I'm not sure I understand what you want. This change should not be noticeable to the user, it just changes how responses are stored in the app. Can you elaborate on what you're asking for?

@JurrianFahner

This comment has been minimized.

JurrianFahner commented Jul 7, 2017

In that case I didn't understand change... If the change is not noticeable to the user, then you can ignore my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment