Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Local mongo database instance for application

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
User avatar
neddie
Posts: 380
Joined: 2009-09-14 07:57

Local mongo database instance for application

#1 Post by neddie »

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?

neuraleskimo
Posts: 195
Joined: 2019-03-12 23:26

Re: Local mongo database instance for application

#2 Post by neuraleskimo »

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
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Local mongo database instance for application

#3 Post by GarryRicketson »

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.

neuraleskimo
Posts: 195
Joined: 2019-03-12 23:26

Re: Local mongo database instance for application

#4 Post by neuraleskimo »

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
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Local mongo database instance for application

#5 Post by GarryRicketson »

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,..

neuraleskimo
Posts: 195
Joined: 2019-03-12 23:26

Re: Local mongo database instance for application

#6 Post by neuraleskimo »

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
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Local mongo database instance for application

#7 Post by GarryRicketson »

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.

Post Reply