LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-22-2014, 11:32 AM   #1
g_paschoal
Member
 
Registered: Oct 2009
Posts: 131

Rep: Reputation: 15
Doubt regarding mysql or postg for a very simple application


Hi,

I have one question regarding DB performance between mysql and postgree

My application will use a simple sql table. It will only store couple of fields like car plate, timestamp , filename, etc.

It is a access control system so we will just do inserts and some select to gather data. My question is which DB is better for this ? mysql or postg ? THe DB schema is very simple however I will have a lot of data on this table because lots of car will be passing through.

the language I am using is c++ under ubuntu

Can anyone please help me?
Thanks
 
Old 03-22-2014, 11:57 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
I suggest sqlite. Then you wont need a seperate server.

https://sqlite.org/
 
Old 03-22-2014, 01:16 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,217

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Honestly, with the information that we have, the answer is "it doesn't matter."
 
Old 03-23-2014, 02:54 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Whichever is easiest/cheapest. SQLite would be my second choice. Is there a good reason to even use a RDMS for an application this simple? Flat files are probably easier.
 
Old 03-23-2014, 06:57 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,217

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by g_paschoal View Post
THe DB schema is very simple however I will have a lot of data on this table because lots of car will be passing through.
Quote:
Originally Posted by theNbomr View Post
Is there a good reason to even use a RDMS for an application this simple? Flat files are probably easier.
Yeah, I'd say an indexed database would work better than flat files.
 
Old 03-23-2014, 07:05 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by theNbomr View Post
...Flat files are probably easier.
But an important question to ask is how many actual entries there will be over time, how you will want to access and use the data, and whether you see many functional extensions in the future.

With a simple data structure as you describe basic performance will not be an issue.

If you never much access the historical data other than in/out like a parking lot then it really doesn't matter how you store it. But if you need to generate reports and summary data periodically, or correlate with other data then an RDBMS would be your best bet.

Also, if you expect the application to be extended in other ways in the future, use of an RDBMS would isolate the data and facilitate future extensions.
 
1 members found this post helpful.
Old 04-02-2014, 10:34 AM   #7
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
sqlite is excellent.

Setting up a full blown SQL database is not a lot of fun.
 
Old 04-02-2014, 05:08 PM   #8
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Solid advice from previous posts. In a case like this, for me it is down to what I know how to use. If you have a personal preference or extensive knowledge, just use what you know already.
 
Old 04-06-2014, 01:01 AM   #9
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Formally, any version of mySql that is not for personal use is a paid product on any OS.

OK
 
Old 04-13-2014, 12:50 PM   #10
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
Quote:
Originally Posted by dugan View Post
Honestly, with the information that we have, the answer is "it doesn't matter."
This is the right answer.
 
Old 04-13-2014, 09:18 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,633
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931
I would consider only a true server-based RDBMS for an application like this ... which disqualifies SQLite in this case ... but, insofar as which server-based system to use (there are dozens besides the ones you named here), I suggest that you defer this decision until you have fully developed the technical requirements of your entire application, and of the technical context in which it will be expected to operate.
 
Old 04-14-2014, 11:41 AM   #12
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
So, how do you reach the determination that only a true server-based RDBMS is appropriate before that rigorous requirements study has been completed?
 
Old 04-15-2014, 09:40 AM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,633
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931
Quote:
Originally Posted by dugan View Post
Yeah, I'd say an indexed database would work better than flat files.
Definitely. If what you ordinarily might be looking at is "flat files," or a collection of them, then SQLite is an excellent, very high-performance choice. You get all the simple advantages of local files, plus "400 cubic inches, V-8 and a four-barrel carburetor."

There's only one fairly-huge caveat: "use transactions!" If you don't, then SQLite is designed to physically verify every disk-write and will not cache any reads, which makes its performance seem horrible until you catch-on to what it's doing and why. For both reads and writes, start a transaction, do your work, commit. As long as you do that, it's: "grab ahold of your hat and hang on!"

---
Now, am I saying "SQLite is the right thing to do here?" No. In this case, I think that a server-based system is called-for and the app-specific research work has not yet been done which will demonstrate which system will turn out to be best.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Doubt in MySQL query karthilin Linux - Newbie 1 10-26-2012 04:40 AM
mysql doubt maheshp86 Linux - Server 1 09-14-2010 07:29 AM
[SOLVED] simple curl syntax doubt sl33p Linux - General 1 07-06-2009 04:18 PM
Doubt in MySql vibinlakshman Programming 2 02-17-2009 12:08 PM
Doubt in a simple basic C program.... thefountainhead100 Programming 9 03-15-2008 01:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration