Link to home
Start Free TrialLog in
Avatar of star90
star90

asked on

Which Database shouls I use for fast data access with Visual C++?

Hi,
I am writing a C++ program that reads in Forex Data of Currencies values.
Reading it to the memory from text files takes a long time.

I am using a PC with vista 64 bit and Visual C++ 8GB Ram.
1) Which database should I use?
2) Any speed reference comparing to memory access?

3) Which Databases can use a lot of Ram for faster results?
 e.g. 4 GB of Data that is hold in Ram?

Any article abou it?
Thanks

Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Hi Star,

All of the modern RDBMS will use as much or little memory as you can configure.  If your server has 32 or even 64GB, you can use it.

The real question is I/O volume.  How many transactions/second do you need to sustain?  How many in burst?

MySQL is probably sufficient for your needs and is free.  If you work for someone that wants a traditional vendor and support, I'd recommend DB2.  Of course, you'll get just as many people endorsing Oracle, which is just as capable.


Kent
Oracle offers a free version, but will limit it's use of resources.
Avatar of star90
star90

ASKER

I have one PC so I want the Database and the client to be on the same Computer.
If for example I want to be able to run on 8 million values of a specific currency for a segment.
Do I need first to read the Data from the Database first into the memory ?
Or do I access it value by value?

Assuming I want to read 8 million of floats values, how long would it take?

I also want to understand, Assuming I keep some data in my program using  STL containers, how do I convert it to Databases? Is it complicated?
Thanks



Hi Star,

8,000,000 rows is pretty modest with today's processors.  Of course, reading all 8 million for a single query will take a bit of time.

But that's the job of the RDBMS.  Managing the data and controlling the I/O.

Depending on the data, structure, and usage, you may be able to make that very, very efficient.  But it's not a "here's the solution" kind of venture.  It takes a knowledge of your data, and a good database design to make it work really well.


Kent
One thing you should keep in mind is selecting ALL values from RDBMS is no way faster than reading a file at once unless you´ve got in in RAM.

Please correct me if I am wrong, but I think there is a lack of understanding of client/server and what a RDBMS does?
One won´t receive all data with his client and work on it locally when using a RDBMS. One would send a SQL statement to it, select its data there and only work on a small resultset on the client. This is very important to consider!

mySQL as well as postgres and other non-free won´t have any trouble handling this. This would just be a matter of your personal taste. E.g. I´d go for mySQL since I am not familiar with postgres and that´s the only reason.
Avatar of star90

ASKER

Where do I start?
I understand that Visual c++ 2010 has SQlite inside.
Is it a good starting point?
any good tutorial about it?

Assuming some of my data is stored inSTL  vectors and STL maps, how do I save it to the database?
Hi Star,

Designing the application and the database are related, but only loosely so.  A good database design is critical, though it should be tolerant of the application's (client's) needs.

STL vectors and maps have to equivalent in SQLite.  You'll have to engineer the database to accommodate the objects in the vectors, and explicitly transfer data to/from the vectors and database.  Depending on your needs, you might find that you want to drop the vectors from the application and let the RDBMS manage all of that.


Kent
Avatar of star90

ASKER

How do I start practically with Visual c++ and SQlite?
DO I need to install SQL server?
Any good tutorial on how to start?

Hi star,

SQL Server and SQLite are two entirely different things.  They are NOT easily compatible.

SQLite has extensive documentation, but it's not particularly user friendly.  It's more reference material than tutorial.

Still, here it is:

  http://www.sqlite.org/


Kent
Avatar of star90

ASKER

Assuming I can use SQlite or SQL Server (Which comes with VC++ 2010.
Which one is faster? which one is easier to use and study?
I don't believe that you'll see much speed difference between the two.

SQL Server is probably easier to use, but I'm pretty sure that VC++ does NOT grant a license to run SQL Server.  You can develop clients against a SQL Server database, but you need a separate license to run the server (which is, ultimately, the database).


SOLUTION
Avatar of Ferrosti
Ferrosti
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of star90

ASKER

Thanks.
Assuming I choose the Microsoft SQL server.
Any good starting point with examples?
Avatar of star90

ASKER

Hi Ferrosti,
Thanks for the information I did not know that I can´t run the SQL server on the same machine.
I will read about postgresql.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial