bbyars / mountebank

Over the wire test doubles
http://www.mbtest.org
MIT License
2k stars 268 forks source link

Support custom database options in addition to --datadir #591

Open bbyars opened 3 years ago

bbyars commented 3 years ago

The --datadir CLI flag introduced a file-based database, but it runs into file locking issues at load. Rather than coupling to a specific database technology, it would be better to add custom support (analagous to the --formatter flag). The impostersRepository has now defined a JavaScript interface (even if it's quite clunky), allowing module inclusion.

gePower commented 2 years ago

Hi, can you assign me to the issue?

bbyars commented 2 years ago

Before you spend time on it, let me check on a parallel initiative first. I'd talked to someone else about this using a plugin model.

gePower commented 2 years ago

Perfect !

jbadeau commented 2 years ago

what about something like https://knexjs.org/?

gePower commented 2 years ago

Intressting, there is https://sequelize.org/ too or mongoose !

TetsujinOni commented 2 years ago

I'll note that in extreme cases, --datadir will exhaust the filesystem it's running on when request-recording is enabled and a high number of requests are made in load-testing scenarios. A less incompressible backend for imposters could be useful independently of a generative imposter.

bbyars commented 2 years ago

Yep. There's a mongo db implementation in the works that should be a much more robust solution. The --datadir did at least force creating the right interface (and a painful refactoring from sync operations to async), but having a pluggable persistence mechanism is the next step. -Brandon

On Mon, Oct 10, 2022 at 3:05 PM Jonathan Choy @.***> wrote:

I'll note that in extreme cases, --datadir will exhaust the filesystem it's running on when request-recording is enabled and a high number of requests are made in load-testing scenarios. A less incompressible backend for imposters could be useful independently of a generative imposter.

— Reply to this email directly, view it on GitHub https://github.com/bbyars/mountebank/issues/591#issuecomment-1273756307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARFP473WKGG5EEFGW33BLWCRZI3ANCNFSM4VN4MQBQ . You are receiving this because you authored the thread.Message ID: @.***>