|
just another regularban.info web blog |
| MEMBERS: | Web Marketing and the Potential in a Multi-Site Design
The concept of web development may include more than a singular ecommerce website. I have talked about the subject of web development in light of positively constructing a website. I've also talked about the mentality needed to envision the entire site prior to launch so you have some idea of where you want to go. The goal also included the need for a plan for growth and site expansion. This article looks at the subject from the point of view of a corporate office with a few satellite offices that support and expand the potential of the primary business. In a brick and mortar store environment it is often true that a business will start in a singular location. As trust is built through longevity and commitment to quality and service the business grows. If the business does well the owner may decide to develop a second store in another city within the region of primary service and support. Other stores may be opened as a result of the ongoing success of the overall operation. The idea is multiple stores - one brand. Web development may be the mirror image of the brick and mortar model. Why do I say mirror? Well, because in the case of an online environment an ecommerce business owner may be better served by starting with the secondary stores and building up to the primary online business portal. If you're thinking, "That does seem backwards," allow me to explain. These satellite stores should have direct links to your primary site. Each satellite may have its own emphasis, but will always relate to the thrust of your main business. The end goal remains the same, multiple stores - one brand. Why develop more than one site? In web development the idea of more than one site could mean improved site rankings for your primary site and additional opportunities to reach potential customers. Think of it this way. Each satellite website you develop can take on a distinct list of keywords or phrases. Each will be associated with your primary product. All content on the site will be geared toward the specific keyword or phrase. If you have four supporting sites that can go online at the same time as your primary site you have five distinct opportunities to reach consumers with your message. Work to optimize each site for search engines and select unique and researched keywords or phrases for each site. Is that the only benefit? By developing your web presence this way you begin the process with backlinks already in place from the satellite sites to your primary web presence. As your Search Engine Optimization (SEO) strategies begin yielding results they should do so in all five instances and ultimately this effort benefits your bottom line. By having five separate sites that market the same product from a slightly different vantage point the potential improves for increased sales. This is true not just because there are more sites for consumers to view, but because search engines will connect with this scenario and provide improved rankings earlier. Proper web development may include more than one site and more than one approach as the vehicle used to maximize the overall potential of the product or service being marketed.
Website Optimization - Site Working Okay?
How's your website, then? I'm not asking whether it's a good site or not, but what its performance is like. Is it slow to load? Does it have problems with certain web browsers? Occasionally you'll find that code working perfectly on, say Internet Explorer, doesn't work with Firefox. And vice-versa. Any coding problems? How should I know? Who... who cares? I hear you ask. Because it's important. You only have seconds -- tenths of seconds, even -- to make an impression on people who come to your site. If the site isn't working, has dead links or some old code that doesn't work and leaves the site with blank areas, you can bet your life those lovely, potential customers will click away at the drop of a pixel. And more than likely they'll be clicking away to the welcoming site of one of your competitors. Wake up and smell the Mugicha! After reading this post you no longer have any excuses for not knowing. There's a website I often turn to when I want to see how my own site is doing, performance-wise. It makes for uncomfortable reading sometimes, because it doesn't hesitate to tell me stuff I don't particular want to hear -- the site's too heavy, too many images, too many elements, you've failed at life, you're a bad, bad person... et depressing cetera. But it's well worth it. I have no connection whatsoever with the owners of the site and this isn't an affiliate link, so click in confidence. Here it is: http://www.websiteoptimization.com/services/analyze/ Put in the full address of your website and have a look at what it says. Pretty eye-opening stuff, eh? You didn't realise it was that bad, did you?! I'm not particularly interested in contacting the owners of the site to ask for their optimization services, but the results I get when I check my site are very interesting. Useful, too. Oh, and completely free. Check it out.
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.
|
* About Archives
Categories:
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). |