Skip to content
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
Merged

Conversation

gschier
Copy link
Contributor

@gschier 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 Compare June 29, 2017 01:09
@gschier gschier force-pushed the performance/response-bodies-to-fs branch from 042cd58 to 40f3463 Compare June 29, 2017 01:12
@gschier gschier force-pushed the performance/response-bodies-to-fs branch from 456cadd to c59cb90 Compare June 30, 2017 02:54
@gschier gschier force-pushed the performance/response-bodies-to-fs branch from c59cb90 to 9a04884 Compare June 30, 2017 03:07
@gschier gschier merged commit de610f4 into develop Jun 30, 2017
@gschier gschier deleted the performance/response-bodies-to-fs branch June 30, 2017 03:30
@JurrianFahner
Copy link

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
Copy link
Contributor Author

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
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants