sqlgrid icon indicating copy to clipboard operation
sqlgrid copied to clipboard

How to switch "bucket" within the same instance?

Open zllovesuki opened this issue 7 years ago • 5 comments

Currently the a SQLGrid instance is instantiated per bucket (const bucket = SQLGrid()). What's the best strategy to "change" to a different bucket on the fly?

zllovesuki avatar Apr 11 '18 22:04 zllovesuki

The short answer is, you can't.

A bucket is just a set of database tables for writing files.

Why do you need more than one though?

internalfx avatar Apr 11 '18 22:04 internalfx

pseudo-multi-tenancy :P

zllovesuki avatar Apr 12 '18 21:04 zllovesuki

As a suggestion....

Treat your filenames like paths.

Ex: filename = '/USERNAME/some-file.jpg'

internalfx avatar Apr 12 '18 22:04 internalfx

It’s not ideal. With the ability of table replication policy from CockroachDB, it’s possible to have a situation where you want a separate bucket within the same SQLGrid instance.

zllovesuki avatar Apr 16 '18 09:04 zllovesuki

I see, like GDPR compliance?

How many buckets are we talking about 20? 1000?

internalfx avatar Apr 17 '18 13:04 internalfx