Skip to content

[couchbase] Add support for ephemeral buckets. #4807

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

daschl
Copy link
Member

@daschl daschl commented Dec 29, 2021

This is a smaller change and can in theory be done in isolation, but to not break the chain I'd prefer if it gets merged after the other 2 preceeding changes.

…ion).

This changeset explicitly configures the service memory quotas to their
documented limits by default. This ensures that if a service is enabled,
it does not consume more memory than absolutely needed. This is important
because some services (like analytics) try to grab memory available which
is good for production but of limited use in a testcontainers setting.

A new API is also added which allows to customize the memory quota for
each service should the test case require more than the minimum (which
for most services is 256MB anyways).
This changeset allows to specify scopes and collections to be automatically
created, which is available with Couchbase Server 7.0 and later.

The BucketDefinition is expanded to take a ScopeDefinition which itself
can be configured with CollectionDefinitions. During startup, after the
bucket is created, the scopes and collections are stored on the server.

Note that as a nice "bonus", similar to a primary index being automatically
created on a bucket by default (can be turned off), this change also
automatically adds a primary index for each collection created, as long
as the query service is also enabled.

If the server does not support it, a descriptive error message is shown.

Further Reviewer notes:

 - The primary index creation and keyspace checks have been refactored
   into their own methods since they are now called from two places: once
   for the bucket only and once for bucket, scope and collection triple.
 - A test case has been added to verify using custom scopes and collections.
   To make this work, the enterprise image has been bumped to 7.0 from 6.6.
   The community image is left at 6.6 - we could bump it too, but this gives
   us a little more test coverage on server versions (pre and post collection
   support) for free.
Ephemeral buckets, other than the default Couchbase buckets are
purely in-memory and as a result have different tradeoffs in a
production setup. For testing though, it can make sense to use
them instead of the default ones if no views are needed and
less disk access in a CI environment is needed (which may
speed up tests).
@daschl daschl changed the title Add support for ephemeral buckets. [couchbase] Add support for ephemeral buckets. Dec 29, 2021
@rnorth rnorth added this to the next milestone Jan 5, 2022
@bsideup bsideup modified the milestones: 1.16.3, next Jan 18, 2022
@kiview kiview removed this from the next milestone Apr 7, 2022
@eddumelendez eddumelendez requested a review from a team as a code owner November 19, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants