LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Doubt regarding mysql or postg for a very simple application (https://www.linuxquestions.org/questions/programming-9/doubt-regarding-mysql-or-postg-for-a-very-simple-application-4175499102/)

g_paschoal 03-22-2014 11:32 AM

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

Guttorm 03-22-2014 11:57 AM

I suggest sqlite. Then you wont need a seperate server.

https://sqlite.org/

dugan 03-22-2014 01:16 PM

Honestly, with the information that we have, the answer is "it doesn't matter."

theNbomr 03-23-2014 02:54 PM

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.

dugan 03-23-2014 06:57 PM

Quote:

Originally Posted by g_paschoal (Post 5139326)
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 (Post 5139932)
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.

astrogeek 03-23-2014 07:05 PM

Quote:

Originally Posted by theNbomr (Post 5139932)
...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.

bigearsbilly 04-02-2014 10:34 AM

sqlite is excellent.

Setting up a full blown SQL database is not a lot of fun.

ericson007 04-02-2014 05:08 PM

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.

AnanthaP 04-06-2014 01:01 AM

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

OK

eric.r.turner 04-13-2014 12:50 PM

Quote:

Originally Posted by dugan (Post 5139383)
Honestly, with the information that we have, the answer is "it doesn't matter."

This is the right answer.

sundialsvcs 04-13-2014 09:18 PM

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.

theNbomr 04-14-2014 11:41 AM

So, how do you reach the determination that only a true server-based RDBMS is appropriate before that rigorous requirements study has been completed?

sundialsvcs 04-15-2014 09:40 AM

Quote:

Originally Posted by dugan (Post 5140033)
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.


All times are GMT -5. The time now is 05:07 PM.