tags:

views:

434

answers:

13

I just got a decent idea for an application, but it would involve some database work and a central server.

I have never worked with databases or servers before. What are some advised database query languages for a beginner? The languages I work with right now are C#, C++, Perl, and Python, but I do not care if I have to learn another language (that is always fun).

  • Which language should I use?
  • How would I work with a server?
  • If I distribute my program and use a computer on my network as a server does it open up a security hole? If so, how should I deal with this?
  • And how would i setup the server, just download the installer and run it?
+1  A: 

Learn SQL.

Download SQLite as your learning server.

That will get you started.

Once you've learned SQL, you can move on to the other questions.

How would I work with a server? MySQL or Postgres would be good, inexpensive choices. Oracle, MS SQL/Server and DB2 are good expensive choices.

If I distribute my program and use a computer on my network as a server does it open up a security hole?

This is a huge topic. Start with one of the widely-used vulnerabilities lists. Here are some pointers: http://homepage.mac.com/s_lott/iblog/architecture/C465799452/E20090124205231/index.html

S.Lott
SQLite is not a server.
skypher
@skypher: that's debatable. It provides the SQL service. It isn't a large, complex, heavyweight free-running process (or Windows "service"). Since it provides the SQL service, how is it not a server?
S.Lott
While it is debatable in an English language sense it doesn't really reflect the usage of "server" in computer engineering; an embedded library (SQLite) definitely does not come under that meaning.In fact it is one point that strongly differentiates SQLite from other SQL systems.
skypher
SQLite provides the SQL database service. How is that not a server? Your point is confusing. Are you claiming SQLite does not provide the service? What are you claiming?
S.Lott
I'm claiming that it's not "providing a service" as commonly understood in a technical sense.It's an embeddable SQL engine or a library but neither a server process, a web service or an O/S service.
skypher
@skypher: Yes. It's an embeddable SQL engine. That's it's strong suit. I use it because it's embedded and VERY lightweight. However, it provides the SQL service. From an ODBC or JDBC viewpoint it appears to my application to be a server.
S.Lott
I don't know about ODBC or JDBC terminology. :/I still think that my point is valid, but this discussion seems to be quite prone to subjective interpretation.So up you go again. ;)
skypher
@skypher: I'm not clear what your point is -- SQLite provides a service. You keep repeating that it's not a "server" according to some standard of "computer engineering". Here's my point -- so what? It provides a service and is indistinguishable (in a few respects) from heavy-weight competitors.
S.Lott
+1  A: 

I recommend you start with C# on the .NET framework, and use MS SQL Server.

First, you will need to get started with databases.

Here is a great place to start with MS SQL: http://msdn.microsoft.com/en-us/library/aa256841.aspx

MS SQL Express is a free edition for people like you while you are learning or evaluating.

Visual Studio also has an express edition for learning.

This will require your learning Transact SQL, which is an enhancement of SQL.

If you are concerned about SQL security there are some good articles out there.

Geoffrey Chetwood
the thing about that site is it directs me to books by topic...and i dont know what any of that stuff means
jimi hendrix
@Jimi: You can find some more basic primer here: http://msdn.microsoft.com/en-us/data/aa937718.aspx
Geoffrey Chetwood
You could potentially use Sql Server Express to run production. I don't remember seeing anything in the license saying you couldnt. Please correct me if im wrong
phsr
+2  A: 

Most commercial databases use SQL as the language, although there are others out there I would suggest you stick to the tried and trusted packages, if you lean towards the open source camp, I suggest you use MySQL alternativly if you have Microsoft tenancies then you should use SQL Server express (ie the free version).

Im not sure what you are asking in how you would work with the server, but Im assuming you are asking about how you develop/build the databases, with SQL Server it has a client program to manage the database whereas with MySQL there is an open source PHP tool for management.

As for security, databases are very secure if they are configured correctly, I suggest reading up on configuration articles for the database platform that you end up selecting.

CodeKiwi
A: 

I recommend learning SQL first. The easiest way to do this is to use Access if you have it. This way you can focus purely on learning SQL syntax and code. Best of all there are sample databases and queries you can look at. Plus you can put together queries using a GUI and then look at the resulting SQL code.

When you are good with SQL, you can then look at which database you wish to use. If you are a 'looking for free software' kind of developer then you may want to look at MySQL. Otherwise I'd recommend Microsoft SQL Server.

If you use MySQL then Perl is a easy language to start with. If you want a nice GUI though you may want C# or VB.NET.

Rob Haupt
A: 

If you are working on a web app, I suggest you start going through Ruby on Rails tutorials. The database is so abstracted and so well-bound to the model that SQL is almost completely factored out and you just think in terms of your business model.

If you are working on an app, get to learning either some binding system or SQL I understand C# has some system (LINQ?) that might make life easier for you...

Bill K
I'm as big as a RoR fan as you but certain things in Rails don't make sense unless you understand fundamentals of relational theory.
Alan
All I said was you didn't have to learn SQL, that's the really tough part. Dealing with table relationships isn't so bad, it's much like good OO programming, and even that is simplified since RoR deals with domain objects and makes the database OO for you.
Bill K
+1  A: 

It really doesn't matter which programming language you choose. The most common way of interfacing with a database is through SQL, which is a simple language which provides a common interface to a large number of different databases. Once you know SQL you can easily use a database from any programming language.

The best place to start is a database called SQLite, it provides an SQL interface to data stored in a simple file on your disk. This means that you can create a database and start playing around and learning SQL without the hassle of setting up a real database server. Depending on your application, it may even be all you need.

The last part of your question is impossible to answer. Any application hosted on a network opens up various security concerns. Much more information would be needed, and hopefully by learning a bit about databases you'll be able to answer some of that for yourself.

cthulahoops
A: 

Learning SQL, o'reilly almost any database works, sql server, mysql, postgree all of them are a nice way to start. You should probably start with python. C# will make you think 'So I click here, here and here, next, next, finish and I am connected to the database' and when you try to make something a little bit different from microsoft's script you'll have a hard time figuring out that the microsoft's wizzards have done with your code. On the other hand working with C# might get the work done(badly but done) which is the first rule about programing, so, basically do whatever you want(but I recommend python and mysql).

About the second question, you will always work with a server if you have to make your application online(its just a matter of how).

About the third question, you will always open security holes when you work on-line you deal with this, first, making your program and then studding your security flaws.

Diones
A: 

you should learn about database modelling, in particular the Entity-Relation Model. SQL is just the technology to talk to relational databases, and that is easy, but knowing how to design your tables in order to satisfy your application's data requirements, and in a conveniente way (i.e. at least in second normal form ) will save you a lot of trouble.

Ismael
+1  A: 

Start with E-R Modeling and then you'll be able to begin learning SQL, for a SQL learning resource I really recommend you SQLZoo: A gentle Introduction to SQL, it's a very good interactive tutorial.

CMS
A: 

I concur that you need to know the SQL language if you will be working with databases. A good book for learning SQL is O'Reilly's Learning SQL, second edition.

You should postpone using a server (which includes avoiding the MySQL system that is used in the above book) while you learn the fundamentals of working with a relational database. I agree that SQLite will be a much better tool to start with, since you can learn about relational databases without the administrative difficulties of a server.

bignose
I've never used sqllite...but that is a good point about not using a server right away...kind of emulates how you would learn sql in an academic setting.
dotjoe
You don't need to learn SQL to work with databases.
skypher
A: 

Which language should I use?

Common Lisp if you are in for an enlightening experience and want to work not only with relational databases (SQL) but also with object-oriented ones.

Other languages tend to support only RDBMS well.

How would I work with a server?

My advice: rent a cheap virtual GNU/Linux server and learn to work on it using SSH.

If I distribute my program and use a computer on my network as a server does it open up a security hole?

Maybe, maybe not. It depends on your program.

The question you asked was approximately analogous to “If I work on my house, do I make it easier for burglars to get in?”.

If so, how should I deal with this?

Read up on secure programming and on firewalls.

Use a sane programming language with garbage collection and deal cautiously with any user input.

And how would i setup the server, just download the installer and run it?

It's a bit more complicated than that. It depends on the operating system and the server software you are going to use.

And what server? A database server (if you're using one), a web server, your application server, something else?

skypher
A: 

As to the issue "How would I work with a server?" which could mean a lot of things. . .

Have you heard of the "LAMP" (Linux-Apache-MySQL-Php (perl, python)) bundle?

It's a fairly widespread way to run a server (apache), a database (mysql), and your programming language of choice.

I run Apache and mysql on a windows machine, and prefer Python for doing database things. It's very easy to use python to interact with MySql and get a GUI up and running that serves as your front end.

Apache is nice to get to know if you're getting into web programming at all. You can use it as a web server, a database server, a source control server, etc.

Baltimark
A: 

LINQ is supposedly the next big evolution of SQL handling, so maybe you wanna google that a bit first.

iterationx