Local mongo database instance for application

Need help with C, C++, perl, python, etc?

Local mongo database instance for application

Postby neddie » 2016-06-05 08:40

Maybe I've started along the wrong path for this problem. You know how digikam has a local sqlite database to store its information? And Thunderbird stores all its emails and things in its own database too? Well I thought an application I'm writing could do with its own database too, and I've started developing it with python3, mongodb and python3-pymongo. And it works fine. It's easy to use from python, it's in the standard repositories, it's cross-platform, and it's relatively well-known, which are all big positives. It's a pretty big install, but that's ok I guess.

But now I'm starting to test it on other systems, and I'm coming across snags. For one thing, Debian's system-wide mongo configuration says that the mongod server should be started on system start. So either I have to kill it (which requires root permissions), or I prevent it from ever starting by changing the system config (which also requires root permissions), or I start _my_ mongod instance using a separate port. At the moment I'm assuming that only one user on the PC is running my application at the same time, but that's a problem for the future.

Then I find in the mongo docs it says "In many cases running multiple instances of mongod on a single system is not recommended". So am I trying to use the wrong tool for the job here? Is there a good (recommended/standard) way to use mongod for a user-level PC application (rather than on a single-purpose server where only one mongod makes sense)? Or should I be looking for an alternative (cross-platform) database to use?
User avatar
neddie
 
Posts: 380
Joined: 2009-09-14 07:57

Re: Local mongo database instance for application

Postby neuraleskimo » 2019-04-28 21:32

Hi neddie,

So am I trying to use the wrong tool for the job here?

In general, I like keeping applications as simple as possible. So, I think it is fair to ask if you really need Mongo. If you don't need concurrent access (single-user) and NOSQL, then Sqlite could might be a better choice.

If you want to use Mongo (or even Postgresql, etc.), then you could deploy your application and the database in a container. This would allow you to have a dev/test/prod set of images. This would also take away some of the cross-platform issues.
User avatar
neuraleskimo
 
Posts: 113
Joined: 2019-03-12 23:26
Location: Bloomington, Indiana, USA

Re: Local mongo database instance for application

Postby GarryRicketson » 2019-04-29 00:32

by neuraleskimo » 2019-04-28 16:32
Hi neddie

The last time neddie Last visited:
2017-06-24 10:55
I don't think they are watching this any more, But who knows:?: they might be back
some day.
@benjamin28,
Excuse me if this sounds rude, but I want to ask, Are you a bot ? I wonder because they (bots) have bad habit of bumping old posts, they don't see the dates and stuff, but then many humans do the same, a bot is not likely to reply, can you confirm you are human ?

The last post in this topic was Postby neddie » 2016-06-05 03:40 , that is 4 years ago, so it really makes me wonder.
Also I notice in the link you posted, the tutorial might be ok for
MongoDB Installation:

This installation guide will be useful for installing MongoDB on Linux (RHEL). Once after the Linux host is ready with an internet connection, below is the process of installation.

Code: Select all
2. Create and configure /etc/yum.repos.d/mongodb-org-3.4.repo file to do the installation using Yum utility.

This would not work on Debian,... of course a bot would not realize this is a forum for Debian users. Can you explain why you posted this here ?
===================
For those that are using Debian, this is available for Debian here:
https://packages.debian.org/stretch/mongodb
There also is documentation and tutorials for installing and using it on Debian, I am not going into all that for now, since there has not been any interest in this topic for 4 years, other then the bots post, and reply to that.
Last edited by GarryRicketson on 2019-04-29 01:02, edited 1 time in total.
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Local mongo database instance for application

Postby neuraleskimo » 2019-04-29 00:55

GarryRicketson wrote:
by neuraleskimo » 2019-04-28 16:32
Hi neddie

The last time neddie Last visited:
2017-06-24 10:55

Ah, sorry. Didn't catch that.
User avatar
neuraleskimo
 
Posts: 113
Joined: 2019-03-12 23:26
Location: Bloomington, Indiana, USA

Re: Local mongo database instance for application

Postby GarryRicketson » 2019-04-29 01:11

No problem really,
If you want to use Mongo (or even Postgresql, etc.), then you could deploy your application and the database in a container. This would allow you to have a dev/test/prod set of images. This would also take away some of the cross-platform issues.

Is good , valid advice, so others may benefit from it,..I also agree,with this:
In general, I like keeping applications as simple as possible. So, I think it is fair to ask if you really need Mongo. If you don't need concurrent access (single-user) and NOSQL, then Sqlite could might be a better choice.

What I strongly disagree with, is posting a link to a tutorial that does not even apply to Debian,.. probably a moderator will fix that later.
Now that the topic has been bumped, it might start some new interest,..
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Local mongo database instance for application

Postby neuraleskimo » 2019-04-29 01:19

GarryRicketson wrote: What I strongly disagree with, is posting a link to a tutorial that does not even apply to Debian,.. probably a moderator will fix that later.
Now that the topic has been bumped, it might start some new interest,..

Agreed. I moused over it, didn't recognize the site, and didn't feel like Googling to check its reputation, so I didn't follow it (security-paranoid now days).
User avatar
neuraleskimo
 
Posts: 113
Joined: 2019-03-12 23:26
Location: Bloomington, Indiana, USA

Re: Local mongo database instance for application

Postby GarryRicketson » 2019-04-29 02:01

I did some checking, but did not find any reports on the site,and actually if some one was using Debian, they could skip the part about using "yum', and install using the Debian repos,... But also, I found much better documentation on installing and using mongod at the official mongod website, in fact I might give it a try on my Debian testing/buster VM,
just for a learning project. There are a few things I don't really like much about sqlite, and mariadb, but that would be another topic.

=== edit==, guess I won't be trying it on Debian testing(buster),it is not available.
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable
cron