use same ravenhq db with two different applications

137 views Asked by At

Ok, I know that this is not an opptimal approach, but I was thining of using the same ravenhq db with two different applications.

Why I'm thinking of it, is because I have two really small web-applications that is going to use ravendb as db. And I have one registered paid ravenHq database.

My two applications is not going to share any documents. And both apps data is not going to grow especially big. So my question is. Is this possible to do, or will there be any complications?

//thanks

2

There are 2 answers

0
Matt Johnson-Pint On BEST ANSWER

It really depends on the particulars of your applications. In general, there's nothing wrong with multiple applications accessing the same database. The RavenDB client library can run from anywhere you like, or you can access the DB with raw HTTP. Just because it's a different app calling into the database doesn't mean you'll have problems.

However, you should consider the following:

  • You could have naming conflicts. For example, if each application has a different class called "User" and you store them in the same database, then you certainly could get users from one application mixed up with users from the other.

  • When you define an index in RavenDB, all documents in the database will pass through it. Most indexes are filtered to documents of a specific type, but again - you could have naming conflicts that cause documents from Application 1 to be indexed with an index you intended for Application 2.

  • Backup and restore might be difficult, as you'd be backing up data from both applications at the same time.

There are probably other areas of overlap. Be careful, and test thoroughly.

0
yoerids On

To keep the technical debt as low as possible, I wouldn't use the same database for different applications if the two applications don't share data.

In the case of RavenHQ I would recommend to purchase a Virtual Machine (via Microsoft Azure or another cloud provider) and install an instance of RavenDb on this server where you can create multiple databases on. This is probably gonna be a lot cheaper than hosting via RavenHQ.