brand drug generic name herbal viagra

just another regularban.info web blog

MEMBERS:

Efficient SQL Databases

Don't be fooled by seeming simplicity. A lot of developers get comfortable with a certain way of designing a database for their web applications that they miss out on techniques they should rather employ to make things run faster and more efficiently. A lot of developers don't bear in mnd that the small site they are creating now might grow into something incredibly large and complex, and the database they designed has become bloated and doesn't scale well to meet the demands of the increased traffic.

This article hopes to provide web developers with a few techniques to help make their database and queries faster and more efficient.

1. Avoid Character Types

When you are designing a database, it is so easy to set all data types to the VARCHAR type as it can then contain any data you want; numbers or text. But character data is amongst the most inefficient data type you can get. If a field is only going to contain numbers, then make it one of the appropriate types (INT, DOUBLE, etc).

Also, wherever possible in your web development code, try to use numeric data types as opposed to characters. One of the most common things a script has to store are flags like whether someone answered yes or no to a question, etc. You could of course store it as 'Y' or 'N' but why not store it as 0 and 1?

The reason this makes a difference is when you have a database, for example, with over 500 000 entries, and are running a SELECT on that field, comparisons are processed a lot faster for numeric data types than character types. Also, if you need to return data to the calling script, numeric data is less memory intensive than character data. In addition, your web development language (PHP, ASP, etc) would also be able to process and perform functions on numeric data better than character data.

I am not trying to convince you never to use character data types. Sometimes it is a necessity, but if you can find ways to reduce the amount of character data processed by your SQL database, the better your server will cope.

2. Normalization

Normalizing a database is really quite a complex process. It is a process that describes a way to design a database structure to avoid repetition of data in your database and can lead to significant performance benefits if employed correctly. However, the entire process of normalisation is a bit beyond the scope of this article as it can fill books on its own, but any developer designing a database should seriously consider becoming knowledgable about normalisation and employing it in their own designs.

For a good tutorial on this process: http://www.keithjbrown.co.uk/vworks/mysql/mysql_p7.php

3. DateTime vs Timestamp fields

This actually relates to 1. a bit. The big difference to bear in mind here is that a field of type DATETIME is actually stored as a series of characters. A field of type TIMESTAMP is actually stored as an integer. So therefore, a more efficient way of storing dates is using the timestamp method. The timestamp has its drawbacks however. For one, you cannot store a date early than 1 January, 1970. Also, timestamps in your script will need recalculating to get to the character format. Because of this recalculation, it may not be better to store as timestamp. It really is a case of testing which format works better for your needs.

4. Use LIMIT where possible

In your queries, if you are doing a SELECT to a database and you only expect a certain number of results, using the LIMIT statement can speed your query up incredibly.

For example, if you have a table of users and you need to run a query to search for one users record, you can use a query like:

SELECT user_name FROM users WHERE user_id = 453;

This query is perfectly valid and will return the right result. But you also know there will only be ONE result. The query above will search the database, find what you want, but then still continue searching after that. It would run a lot faster if you could tell the query that once it has found what you are looking for to stop searching. LIMIT can do this, as this query shows:

SELECT user_name FROM users WHERE user_id = 453 LIMIT 1;

Imagine this scenario. You have a table called logins, that records every login from a user. It currently contains over 2 000 000 records, and you want to find the first time a user logged in. Now bear in mind that because this table inserts data over time, it is already sorted for by date. You could do the following query:

SELECT MIN(login_date) FROM logins WHERE user_id = 4876;

This will return the record you want, but SQL will now have to get all dates for that user, sort them and then return the lowest value to you. Our table is already date sorted simply because of the way it records data for us. So using LIMIT can be more effective:

SELECT login_date FROM logins WHERE user_id = 4876 LIMIT 1;

Because it is sorted, the first one will always be a users first login.

5. Avoid using LIKE

If you have tried to employ 1. above, then hopefully you will be in a scenario where you do not need to use LIKE all that much. LIKE is one of the most inefficient ways of searching a table. LIKE performs a text comparison search in a field and with no wildcards is as efficient as a direct comparison; i.e. WHERE name = 'Jane' is equivalent to WHERE name LIKE 'Jane'. It is when you start introducing the wildcard characters like '%' that things get really hairy.

If you do have to use LIKE, then at least try and make efficient use of the wildcards. These are '_' (underscore) and '%'. Let me explain all this with a real world example.

In a project I was involved in, we had a SQL database storing logs generated automatically from a mail server. Unfortunately, the mail server pretty much just dumped a very long string of text data into a field that contained the data we wanted. A script had to be written to find all logs that referred to a login by a user into the POP server. The only way we could do this was to search every record for a string in the msg field that had the text "User logged in" in it. The first query developed was something like this:

SELECT msg FROM logs WHERE msg LIKE '%User logged in%';

This query took on average of about 35 minutes to process. Obviously not an ideal situation. The way the LIKE worked here was that it had to parse through every single portion of each and every record in the msg field looking for text that matched "User logged in" anywhere in the text. We were able to determine eventually that the text "User logged in" occured at the end of that text in the msg field and so we altered the query:

SELECT msg FROM logs WHERE msg LIKE '%User logged in';

The '%' at the end was removed as we do not want to worry about text after because there is none. The query now only compares text to our string in the msg field at the end of the field and no longer parses through the entire piece of text stored in msg. The query now ran in under 2 minutes. (This was actually still too long, but how we optimised from there is a little beyond the scope of this article.)

Hopefully with all these elements put into practice on your next web development project, you can have a database that runs quickly, efficiently, uses as little resources as possible and wont grind to a halt when the load suddenly increases.

Gareth McCumskey works as the Systems Developer for Synaq, a South African based Linux support and services provider. He has been involved in web development for over nine years and programming since he was 13.

 


How To Keep Web Development Costs Low

Most web development projects include one or more of the following elements...

  • Database design and creation
  • Server-side computer programming
  • Client-side computer programming
  • Web page design

Each of these elements has to work in its own right, and in cooperation with the other elements. The more complex the project, the harder it is to bring it all together and make it work correctly.

How to keep the cost down

Here's how you can make sure your web development costs don't run over budget...

  1. Insist every aspect of the development is described in an Agreement document, and make sure both you and the developer sign it
  2. Don't make changes after work has started

The key to achieving the second of these two items lies with the first. You should insist that an Agreement document be created, and sit in on the process.

You need both end-users and developers in the same room, working through each aspect of the development. The end result must be a document that fully describes the development, is clear (unambiguous), and easily understood by both users and programmers.

Every minute you invest creating this document greatly increases your chance of bringing the project in on budget.

Why it's worth it

Many of the problems that usually cause headaches during a complex development could have been discovered in advance, if an Agreement document had been created. When users and programmers get together and discuss their respective needs thoroughly, the resulting development is far more likely to go smoothly.

This kind of interaction forces both users and programmers to think through what's actually required to make the system work. The ongoing interaction reduces the risk that person A assumes person B knows what they're talking about.

Users are committing to a specific set of functions for an agreed price. The developer is committing to develop those functions for an agreed price. This means both users and developers have a self-interest in being thorough.

Should a user change his/her mind about something after the Agreement document is signed, the cost of development must be renegotiated. This punishes the user for failing to think things through.

Should the developer discover he/she hasn't fully understood what's required to complete some aspect of the project, he/she can't ask for more money. This punishes the developer for failing to break down each stage of the development and understand what's involved in completing it.

Assuming you do your part, you won't need to make changes after the work has started. As a result, you'll bring the project in on budget even if the developer hasn't done his/her job properly.

Wayne Davies is a web developer based in London (UK). He has 8 years worth of experience in web design, database design, and web site development: http://asureimage.com/web-development

WA Davies - EzineArticles Expert Author

 


Everyone Is Talking Web 2.0 Development

In layman language Web 2.0 means the second generation of web development. The first generation web development is considered to be the great dot-com bubble of late 90's and the rupture of which around late 2001 triggered ubiquitous reactions that the Web was over hyped. Concept of second generation of Web development started after a media conference between O'Reilly and MediaLive International. In this brainstorming session it was realized that the web has thrown up more interesting applications and Web technology has emerged more important that ever and the word Web 2.0 was coined. Web 2.0 is a business revolution making a bent towards the web as a platform. Web 2.0 doesn't have a definite boundary and there are several things encompassing a core. Web 2.0 is visualized as principles and collection of numerous sites running on those principles at some distance from the core.

Since then Web 2.0 has remained a top level discussion for proper definition and boundary that is yet to be reached. One can simply say blogs, social bookmarking, wikis, podcasts, RSS feeds, and lightweight business over a single platform. Web is no more one way, now uploading, and downloading of information happens simultaneously, sharing and distributing contents across networks leveraging the power of "Long Tail".

Web 2.o includes numerous practices. Here are some typically implemented practices by websites:

• Well-off internet applications based on Flex or Ajax.
• This intend to allow information intended for end-users, such as contact information, calendar events, geographic coordinates, content life, social relationships etc
• Presentation is separated from content through Cascading Style Sheets (CSS).
• High-end APIs (Application programming interfaces).
• Content Syndication through RSS or Atom.
• Facility for content creation through users, also by machines from client side or server side.

Content Syndication: Syndicating partial or whole content through standard protocols such as RSS, Atom, and RDF by using XML so as to be used by the end-users for their need.

Some misconceptions on Web 2.0:

• Curvy designs (This curvy structures became widely popular at the same time, designers also started making more websites with this cool looking styles)
• Use of Ajax or Flex (Which happens to come in the same time of Web 2.0, No doubt that websites with web 2.0 architecture needs these to work well.)

Web 2.0 is not an alien to criticism and had its fair share. Here are some criticisms leveled at Web 2.0

• Web 2.0 is not a new version of World Wide Web at all. It merely uses the technologies and architectures of Web 1.0.
• Ajax is not substituting the HTML protocol; it's an additional layer over HTML.
• Blogs or social networking was features of Amazon.com since 1995 when the word called Web 2.0 dint exist. It's way more than only blogs and social networking.

Jonathan Popoola graduated in Business and I.t in 2003 and has since specialized in web design gloucestershire and web design cheltenham. Visit my site for more information on webdesign.

 


Pages 
* About

Archives
    * February 2008
    * January 2008

Categories:
* Uncategorized

Last Updated:

regularban.info is proudly powered by WordPress MU running on  regularban.info.
Create a new blog and join in the fun!
Entries (RSS) and Comments (RSS).


  blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor blackhatseotoolsmentor