Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kag1

Databases...

This topic is 5218 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to start using databases when in my programs, but a couple things are confusing me. The first being... MySQL, this is just simply a database program, such as access is correct?. And if I make a database in this, could I open such a database in say MS Access?. And If I already have MS Access, is there even really a point in downloading MySQL, or could I just simply use Access for everything (I''m asking this because one of the main points I hear about MySQL is that it''s free) And another thing, if say I make an application for people, that creates a database, and loads and stores stuff in it and such, would they actually need a database program on their computer (such as Access) to even use the program? Or is it more something just like include a .lib and .h file and it works anywhere? Also, is the database support significantly easier for say c#, or is there a nice little class for it or anything like that? Thanks for your guys'' help P.S sorry if my questions are worded bad and such

Share this post


Link to post
Share on other sites
Advertisement
Well, the first difference between mySQL and Access.

mySQL is only a DB Engine. That means, it doesn''t run with a GUI. You issue your SQL queries and it runs them. You''ll have to use your app, or another app, or some frontend to view the results.

Access on the other hand, is a DB Engine AND a frontend. Manipulating the frontend send queries to the engine, which eecutes them. the frontend shows the result.

Access can be used as only a frontend to mySQL (I assume mySQL has ODBC support... hope so.)

I heard mySQL wasn''t lightning fast, so the speed differences with Access might be minimal. However mySQL does have the advantage of being available on many platforms.

If yuo have Access and are already proefficient with it... I''d give it a try. You can always convert to mySQL later without substancial code change.



PS: I''m not sure about the word engine, as I do not speak often of databases in english.

Share this post


Link to post
Share on other sites
MySQL dtabases and MS Access databases are not compatible.
I would strongly recommend MySQL instead of Access.
However, if you are into gamedev, avoid DB''s or if you must, use SQLite

Share this post


Link to post
Share on other sites
Well If I create a Program, that say stores names and phone numbers in a database (just for example), would the computer that I actually run the program on, be able to create a .dat database and query the database, without having an actually DataBase Engine on it? (such as MySQL)? Or for every computer that uses the database have to have one of those programs?

[edit]
sorry, sat a book on the enter key when i read this over, the space is gone now
[/edit]

[edited by - kag1 on June 7, 2004 5:50:17 PM]

Share this post


Link to post
Share on other sites
You would need the database program in all* cases. A database is not just a "database". It is a specific format that is almost always native to the database product (Access, MySQL, PostgreSQL, MS SQL, etc). Even the so called "dBase" compatible databases have differences (i.e. Fox Pro creates its own index files and then gets really mad if another app uses the database file without knowing how to update the index).

You also need to understand the difference between an embedded database and a database server. An embedded database is usually stored in a single file, which can be directly opened and manipulated by the application. Access and SQLite would be examples of an embedded database. While compatible in theory, embedded databases are usually not appropriate for multiuser environments. A major advantage of them is that you don''t need to install a seperate database server and have it running in the background.

A database server is a seperate application or service that sits in the background. Applications connect to this database, the native method usually being via a network loopback, and make requests. The server processes the requests and returns the results. A database server is better suited to a multiuser environment because it does not rely on OS level file locking to prevent conflicts between users. Instead the server can see and organize all client requests, and perform whatever isolation is required.

As mentioned Access is a single file, embedded type of database. While it has rich SQL syntax, it is not designed for speed or scalability. Instead the focus with Access is the application front end. Where as with other databases you would need to write a seperate application to work with it, Access provides all the tools for even a novice or non-programmer to create a database application. Wizards and design screens even allow the creation of complicated queries without needing to understand SQL.

MySQL is an open source server database that is popular due to its position in the Apache/PHP/MySQL no-brainer configeration. It''s syntax is fairly constricted (if you upgrade to version 4 you''ll be able to use UNIONs, and if you use the latest beta you can use the experimental subquery support) and while faster then Access (anything is faster then Access) it doesn''t set any speed records, in particular if you are trying to insert data or make complex queries. The main strength of MySQL is in doing many simple queries at once in a multiple user environment. A MySQL database will span many files, and asking a regular user to install it is well beyond reason unless you are providing a major system (an address book is no reason to have a server running 24/7 on a persons machine, especially considering how long it takes the MySQL service to startup and shutdown)

If you want to use a database in a game or other small app you should look at SQLite. It is free and open source (and like PostgreSQL it has a more open licence then the restrictive GNU MySQL), and normally comes in a tiny DLL requiring only a few procedures to use.

*Microsoft Access and a few other databases are typically supported "out of the box" on Windows machines thanks to the fact that Windows comes with ODBC drivers for them. ODBC is a type of standard database access driver, which means you can write a application and, in theory, use any database so long as it has an ODBC driver. You could think of ODBC as the DirectX for graphics cards - you don''t need to write for specific cards, just ODBC. Other databases, like MS SQL, MySQL and PostgreSQL all have ODBC drivers.

Share this post


Link to post
Share on other sites
quote:
Original post by kag1
And another thing, if say I make an application for people, that creates a database, and loads and stores stuff in it and such, would they actually need a database program on their computer (such as Access) to even use the program? Or is it more something just like include a .lib and .h file and it works anywhere?

No, they don''t need Access, but they need the database engine (meaning a shitload of DLLs). It''s been a few years since I worked with Access, but if I remember correctly, and if things haven''t suddenly got a lot better, then prepare for redeployment hell

If you just want to use databases as local single-user files, then SQLite is a great idea. A very nice engine. Redeployment couldn''t be easier: Just ship a single Win32 DLL - no DLL Hell, no evil COM DLLs or a tangled mess of dependencies. IMHO there''s only one serious problem with SQLite: it doesn''t enfoce foreign key constraints.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!