Jump to content
L8V2L

Database

Recommended Posts

... What's a database?Is it just a directory--folder-- full of sub-directories, and files, and a API built along with a database management system interface, for the API in particular?What's a database?I'll also to Christmassy cookies if you have that. The soft ones.

Edited by L8V2L

Share this post


Link to post
Share on other sites

What does it look like? Is it a file storage?

Share this post


Link to post
Share on other sites

The server-side language talks to the database through an extension or driver. The data inside the database cannot be accessed directly.

Share this post


Link to post
Share on other sites

Self directed learning is hard work.

Edited by niche

Share this post


Link to post
Share on other sites

Relational database are tabular.What are these store in? Reqular folders files?... Are database like a wrapper object that hold other objects --dicrecrories, i.e. folders--, and those object hold other objects or primitive data --files, i.e. documents containing texts, and numerical data--. And this wrapper object contain methods i.g. SQL for accessing these object and their data --i.e. folders, and files--.Is that what a database is? Yes or no, then a description please.

Edited by L8V2L

Share this post


Link to post
Share on other sites

Relational database model is tabular because it is used to store information unique to each entity. E.g form details of each member of an organisation. Get it easy. Database is a collection of information stored in an orderly manner and is managed by a DBMS ('Database Management System': a software that's used to create, organise, store and access a database). I'm just trying to simplify my naivity so I might get it wrong. I welcome corrections. The collection of data make up the database, just as a collection of pictures can make a gallery. That's step-1.

Share this post


Link to post
Share on other sites

Relational database model is tabular because it is used to store information unique to each entity. E.g form details of each member of an organisation. Get it easy. Database is a collection of information stored in an orderly manner and is managed by a DBMS ('Database Management System': a software that's used to create, organise, store and access a database). I'm just trying to simplify my naivity so I might get it wrong. I welcome corrections. The collection of data make up the database, just as a collection of pictures can make a gallery. That's step-1.

You're correct in your own explanation.But it can get overly complicated.I aim to make my database simple as possible.Storing the data in XML, and JSON structure. Edited by L8V2L

Share this post


Link to post
Share on other sites

I aim to make my database simple as possible.Storing the data in XML, and JSON structure.

 

As usual I have no idea what you are talking about. Are you also going to write your own DBMS in C++?

Share this post


Link to post
Share on other sites

XML and JSON aren't databases because the data cannot be ordered or related.

 

In a database you can ask for "all cars that are green, ordered by purchase date" or "all cars that were owned by John Smith" or even "5 cars that were owned by John Smith and John Smith's age". You can't do any of that with XML or JSON.

Share this post


Link to post
Share on other sites

XML and JSON aren't databases because the data cannot be ordered or related. In a database you can ask for "all cars that are green, ordered by purchase date" or "all cars that were owned by John Smith" or even "5 cars that were owned by John Smith and John Smith's age". You can't do any of that with XML or JSON.

????.... If you say so. Edited by L8V2L

Share this post


Link to post
Share on other sites

????.... If you say so.

 

 

It might help if you explained what you are thinking. The file structure of a database is irrelevant to a user because you can't access those files directly. Only the database DBMS is allowed to touch those files.

Share this post


Link to post
Share on other sites

It might help if you explained what you are thinking. The file structure of a database is irrelevant to a user because you can't access those files directly. Only the database DBMS is allowed to touch those files.

There is a language for query object-oriented database. Definitively for XML!So I don't know why he would say that.I just... Would like to have a conversation --and learn from others-- I highly appreciate if you just want to type something to have other read it. I want to talk about things that is toward my goal; building a game website.I choose XML and JSON cause it's not hard to figure it out, when looking at it in its raw form.XML have a querying language that exceed SQL, and XML is in the format of html, plus it also have XSLT.I was considering of having XML hold the data that I will display in my web-page by transforming it via XSLT. And using JSON to store my user information.I have grown fond of XML, and desire to make my web page XHTML.Please give feedback davej.Even if you just talk on your database. Iron sharpen iron. Edited by L8V2L

Share this post


Link to post
Share on other sites

XML and JSON aren't databases because the data cannot be ordered or related. In a database you can ask for "all cars that are green, ordered by purchase date" or "all cars that were owned by John Smith" or even "5 cars that were owned by John Smith and John Smith's age". You can't do any of that with XML or JSON.

I didn't know you post this, I though it was davej. In this case, I will respond. You can query XML to that extant. xQuery.

Share this post


Link to post
Share on other sites

XQuery does some of the functions, but XML and its parsers are very inefficient. SQL databases are designed to be able to retrieve and manipulate large amounts of data quickly.

 

When using XML, the entire contents of the XML file have to be parsed and loaded into memory in the form of a large data structure. With SQL only portions of data are read from the file and are retrieved directly from the file without needing to pass through a parser.

 

XML also occupies a lot of memory because each element has to have an opening tag and a closing tag that are nearly identical, and sets of data have these same opening and closing tags repeated over and over.

 

The concept of relational tables is not implemented in XQuery either and it's important in database theory.

 

Then there's also the fact that if more than one person is manipulating the file at once some data is going to be lost, real databases are prepared to handle this.

Share this post


Link to post
Share on other sites

XQuery does some of the functions, but XML and its parsers are very inefficient. SQL databases are designed to be able to retrieve and manipulate large amounts of data quickly. When using XML, the entire contents of the XML file have to be parsed and loaded into memory in the form of a large data structure. With SQL only portions of data are read from the file and are retrieved directly from the file without needing to pass through a parser. XML also occupies a lot of memory because each element has to have an opening tag and a closing tag that are nearly identical, and sets of data have these same opening and closing tags repeated over and over. The concept of relational tables is not implemented in XQuery either and it's important in database theory. Then there's also the fact that if more than one person is manipulating the file at once some data is going to be lost, real databases are prepared to handle this.

..... Yeah..... I... I am very fond of XML. The community is very large, as well as it's support. Other language have been built for it, and is xml base --meaning the language it's self is xml--.Yes, your right about the open and closing tag. I can see how that would be a problem for large database, but many of rage for XML to advance. The w3c pride it self of XML!Many could argue to you that xQuery is more advance than SQL.Why, if you do a quick search "xQuery vs SQL", you'll see favoritism toward xQuery over SQL.SQL is said to be here for times to come, and xQuery is not an replacement for SQL, but an alternative.To me, I see SQL as a language that's is part of php.But I have grown find of XML.If you do a search for xqib, you'll see attempts to making xQuery an alternative for js.I have read books to learn xml, xslt, xPath, xQuery, schema --DTD out of respect particle-- xPointer, xLink, etc.The only thing struggle with is choosing a database management system; either couchdb, mongodb, etc --there's a few others--What you said at the beginning about xQuery.. Maybe in 1.0. Version --and even in that version, it had the capability of doing everything that xslt 1.0 could do.XQuery to my knowledge exceed SQL very!Please give me information that will build me up toward my goal, instead of make me second guess my self on the language I have chosen.Add on of editing:I am ver shock to see that it was you Ingolme, that posted this.This would be something that davej would post.I thought you was the good one... Edited by L8V2L

Share this post


Link to post
Share on other sites

You're just using the wrong tools for the job. There's a place for XML, but not as a database. You can use XML to describe the files of a template in a content management system, for example.

 

You don't know SQL, so how can you assume XQuery is better than it? SQL is the tool you use to manipulate relational databases, XQuery is the tool you use to access data in an XML file. The core problem with Xquery is the XML file, I don't care about the language itself but the fact that XML is unbelievably slow to work with means that you can't use it as a database.

 

You shouldn't be shocked that I post like this, because what I'm telling you is what every experienced developer will tell you. You've already demonstrated to us that you don't yet have enough knowledge to decide which languages are better or worse or whether they're even comparable to each other.

 

You shouldn't get fond of any languages, learn the strengths and weaknesses of each one and decide which one is appropriate for each job. Or maybe even have multiple languages working together. You don't just choose a favorite.

 

If you're looking other sources than my word, here's an article:

http://www.room4me.com/index.php?option=com_content&view=article&id=8:xmlvsdb&catid=2:technology&Itemid=5

 

Relational databases are better for handling large volumes of data within a system. They have mature management systems that can efficiently and reliably maintain large quantities of structured data. This data can be updated via transactions that ensure the integrity of the database and the content can be extracted very quickly when properly configured. There is no equivalent XML management system, and using XML documents directly for storing and maintaining large volumes of data can prove both inefficient and unreliable.

 

Consider using a relational database within a system to manage and maintain a large data store, or to manage a data store that is regularly updated by various users. Use XML as the format of data that is delivered to client programs and between components of a distributed system. Creating XML documents from relational database queries is a natural way to combine both technologies.

Share this post


Link to post
Share on other sites

You're just using the wrong tools for the job. There's a place for XML, but not as a database. You can use XML to describe the files of a template in a content management system, for example. You don't know SQL, so how can you assume XQuery is better than it? SQL is the tool you use to manipulate relational databases, XQuery is the tool you use to access data in an XML file. The core problem with Xquery is the XML file, I don't care about the language itself but the fact that XML is unbelievably slow to work with means that you can't use it as a database. You shouldn't be shocked that I post like this, because what I'm telling you is what every experienced developer will tell you. You've already demonstrated to us that you don't yet have enough knowledge to decide which languages are better or worse or whether they're even comparable to each other. You shouldn't get fond of any languages, learn the strengths and weaknesses of each one and decide which one is appropriate for each job. Or maybe even have multiple languages working together. You don't just choose a favorite. If you're looking other sources than my word, here's an article:http://www.room4me.com/index.php?option=com_content&view=article&id=8:xmlvsdb&catid=2:technology&Itemid=5

... No mongodb?What about a JSON database?As noted, I did say, I will like to use XML as a database to store my websites information --each individual web page-- that way I can configure it and shape them in different ways via xQuery and xslt.eXistdb a native database use xQuery as it's full querying language for accessing purpose.I could use a native XML database and or JSON native database. One to store my template for my web site, and another to store information on my users.How does that sound?

Share this post


Link to post
Share on other sites

JSON has the same problem as XML: The entire file needs to be parsed loaded into memory before any data manipulation can occur.

 

If you're not planning to change your website very frequently then XML files are good enough to store its data.

 

As for users, it depends on how many people you expect are going to be on the site at once viewing or modifying user data. If you just expect a few hundred users then an XML file works, if you start getting into thousands or millions then you probably are better off with a database. There's more to it than that, but I don't have time at the moment.

Share this post


Link to post
Share on other sites

Mongodb is a JSON database, but you will find heated arguments regarding its performance claims because it simply works differently, with different primary goals in mind. A conventional database seeks, first and foremost, to provide ACID transactions with extreme reliability and very good error recovery, with a focus on the manipulation of normalized tables. Mongodb seeks to provide an efficient way to quickly store and search JSON documents. Mongodb doesn't even provide a native JOIN. If you need to use joins you will have to write each JOIN yourself in Javascript.

Share this post


Link to post
Share on other sites

JSON has the same problem as XML: The entire file needs to be parsed loaded into memory before any data manipulation can occur. If you're not planning to change your website very frequently then XML files are good enough to store its data. As for users, it depends on how many people you expect are going to be on the site at once viewing or modifying user data. If you just expect a few hundred users then an XML file works, if you start getting into thousands or millions then you probably are better off with a database. There's more to it than that, but I don't have time at the moment.

Thanks for giving this time. If you do get the time, please continue.

Share this post


Link to post
Share on other sites

Why not go for the real thing and stop cutting corners? It seems you're teaching yourself. Learning solo can be difficult, but try getting it whole. Buy books--you lose nothing buying a book. Get good materials. Get the full stuff.

Share this post


Link to post
Share on other sites

Frequently, where we start is no where close to where we need to be especially when we're learning.

Edited by niche

Share this post


Link to post
Share on other sites

To me, I see SQL as a language that's is part of php.

SQL first appeared in 1974. It is old, and very mature. PHP first appeared in 1995. PHP is still maturing. SQL is not a part of PHP, it is a distinct language. PHP does not understand SQL. Databases understand SQL. You can use languages like PHP, C#, C++, C, Java, VB, Perl, Python, Ruby etc to connect to a database and then send commands to the database. The commands are sent as SQL code, because the database understands SQL. The database does not understand PHP code any more than PHP understands SQL code. They are completely separate languages for completely different purposes.

XQuery to my knowledge exceed SQL very!

That statement is meaningless considering the fact that you don't understand what SQL is, let alone what it can do.Here's a question to ask yourself: if you think XQuery and XML are so much better than relational databases and SQL, then can you point to a single major website which uses XQuery/XML instead of a real database and SQL? I'll save you some research time - you can't. Consider a site that has 1 million users in its database. Assume that this site sees only 10 requests per second, so the traffic is not very high. Assume that each user record in the database averages 1KB of data. Since the entire XML structure needs to be read into memory in order to be used (unlike a real database), for that small traffic load of people just logging in, the server would need to use (1,000,000 * 1024 * 10) = 10,240,000,000 bytes ~ 10GB of memory just to handle 10 people trying to log in at the same time. Our dedicated servers each have 24GB of RAM, and it is not all dedicated to the database. That means that, with XML, our servers would only be able to handle 24 people using the system at the same time, assuming that every last byte of RAM was going to the database. Think about how many people use Facebook at the same time. Does it make any sense to use a data store technology that requires the entire database in memory every time any person accesses the system? When someone logs in to Facebook to get their list of messages, it would need to load the entire list of messages that every person has ever sent just to get that one person's messages? Does that really sound like a good plan to you? You have no idea about all of the optimizations that relational databases employ to make data storage and access as fast as possible, technologies that have been used for over 40 years, so what exactly qualifies you to make the judgement that XQuery and XML are so much better?By the way, the XML standard was introduced in 1996. PHP, let alone SQL, is older than XML.
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...