Andrey Yatsyk
Andrey Yatsyk

Reputation: 486

How to limit database size and computing resources in CouchDB?

I’m considering CouchDB for my application. I’ll use one database per user design when logged-in user has write access to own database. How to limit the size of this database? Storage may be cheap but any user could fill entire server storage with garbage and make service unusable for other users.

Also how to limit computing resources for particular user or IP if client starts to send a lot of requests or few but expensive requests to my server?

Upvotes: 1

Views: 326

Answers (1)

Alexis Côté
Alexis Côté

Reputation: 3690

For database's size, data is pretty lightweight. As users modify data, it will create revisions and this makes the database bigger and bigger. By default, CouchDB automatically compact databases when the size limit reach a certain threshold.

From my knowledge, you cannot limit CouchDB database's size. You could probably setup a proxy or some sort of application layer that prevents user from modifying database if their database reach a certain size.

For resource usage, you will probably need to setup a proxy again and throttle your users.

Upvotes: 1

Related Questions