Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18
The web servers may talk to the same database server in which case they see the same information. A single database server properly configured will easily handle the load from ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,567

    The web servers may talk to the same database server in which case they see the same information. A single database server properly configured will easily handle the load from several busy web servers as they tend to be higher spec servers; or at least they have in the places I have worked. When the database load gets to much for one server then you build a replication cluster to handle the load. Replication happens in near real time for the most part.

    There are two types of replication (in the MySQL world)

    1. Master / Slave in which all database writes go to a single master which replicates the data to all the slaves which are read by the web servers.
    2. Master / Master in which all servers receive reads and writes with the replication going in a loop between the servers.

    Also for a bit of homework (yes I am evil) look up atomic transactions and acid compliance.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  2. #12
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,572
    It always amazes me how people expect to get a comprehensive understanding of TPS (transaction processing systems) with just a couple of questions. It took me 10 years of study, practice, and then teaching the subject before I felt I really understood what was going on... Then I wrote TPS frameworks for very large-scale networked systems. This is NOT a subject one masters in a day or two! Read the works of Codd and Date as a start - the math isn't hard, but it is significant!

    In any case, any online store that hope to stay in business will not just have an entry for "number of x available", but "number of x for checkout", and if one minus the other == 0, then it should not let you add it to your basket. If one person that has N of x in their basket, and cancels the order (or it times out), then the "number of x for checkout" will be decremented accordingly, allowing new orders to be registered. Some systems will behave slightly differently, allowing potential back-orders to be placed at the request of the purchaser.

    Also, database systems typically do not have master-slave replication except in cases for redundant backup in case the main server and storage fails. Any sane engineer that implements such systems will make sure that the roll-forward logs are stored on very hardened RAID arrays so that if the main server and/or database file system is munged, they can roll forward the database to get the latest live data installed in it PDQ. I worked with TPS systems for semiconductor, flat panel display, and disc drive plants that had a cost in excess of $10 million USD for an hour of down time. Needless to say, our customers would get really cranky when the software failed, and the redundant aspects didn't work as advertised!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #13
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,567
    Quote Originally Posted by Rubberman View Post
    Also, database systems typically do not have master-slave replication except in cases for redundant backup in case the main server and storage fails. Any sane engineer that implements such systems will make sure that the roll-forward logs are stored on very hardened RAID arrays so that if the main server and/or database file system is munged, they can roll forward the database to get the latest live data installed in it PDQ.
    **sort of OFF Topic and definitely ON Soapbox **
    You should have worked in some of places I have. The stories I could tell. Maybe I should write a book about them and if I was as eloquent as Hazel I probably would!

    How about the company owner (of a small computer consultants) who wouldn't approve the budget request for a firewall to protect the internal network, which was connected to the Internet, no matter how much I begged him for it on the basis "Nobody would be interested in such a small companies servers" Eventually I insisted that he give the refusal and the reasons in writing so that when our customers data was deleted (he wouldn't approve a budget for backups either but that was another battle) he would be sued, not me and when the company servers started serving up child porn he'd go to gaol and not me. I got the budget!

    Master slave database set ups with writes going to one DB and reads from the others was a minor IT sin in that place. Actually, the way the previous guy had configured and written it, it worked quite well for a long while with the relatively few writes going to one server and reads from the other three based on which client group it was. Then overnight it didn't work anymore; it really didn't. I got tasked with fixing it which would involve converting it to master / master and sorting out the code to work in that scenario with almost no time and budget. I looked at what was required, thought <censored> that, resigned and was in a new job six weeks later.

    I could probably write a book about that one company now I think about it!

    No one would believe it though.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  4. #14
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    941
    Quote Originally Posted by resetreset View Post
    I don't understand. Say for an ecommerce site, there's 1 watch left or whatever, and someone places an order for it - server 1 is busy taking the card details, and now a second customer comes in, and sees that there's still one watch left, cause server 1 hasn't yet told server 2 (both under the same load balancer) that the watch has been bought, i.e. inventory is now 0 - how is this handled? Surely there must be some way for the load balancer and all servers under it to communicate (except for simple CPU load)?
    You have to code the site to handle this and the other possibility like the person put the watch in the cart, then doesn't complete the sale so watch becomes available again. So you have work out a scheme to placing items in a holding state so other can't purchase them, but not remove from stock till other person completes the sale. This is were a pad of paper and big eraser come in handy to model you transaction process.
    A lion does not lose sleep, over the opinion of sheep.

  5. #15
    Linux User
    Join Date
    Mar 2013
    Posts
    354
    I'll respond to all these responses later, specially Rubberman, but in the meantime, just a quick question - is it feasible if I was running a site like this, to expect your average hosting company to handle all this for me? do they generally have staff who know how to set up a load balancer etc etc? or do I HAVE to buy my own servers?

  6. #16
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,572
    Quote Originally Posted by resetreset View Post
    I'll respond to all these responses later, specially Rubberman, but in the meantime, just a quick question - is it feasible if I was running a site like this, to expect your average hosting company to handle all this for me? do they generally have staff who know how to set up a load balancer etc etc? or do I HAVE to buy my own servers?
    Most hosting companies should have LB services for you. I know that AWS (Amazon cloud) does - they are called "Elastic Load Balancers", or ELBs for short. They are very easy to set up in regard to which ports to monitor (to determine if a server is available for connections), which ports are forwarded, intervals to check for connectivity to servers, etc. They actually give the LB a valid IP class A address (name.domain) which your customers can use to connect with your servers. If you want, you can alias that to your own host.domain address (such as www.xyzzycorp.com) so customers aren't visibly connecting to amazon.com services.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #17
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,567
    It's not just Amazon these days many companies offer a similar service. I'm not going to recommend a particular one but which ever you consider make sure you read their terms and conditions and privacy policy very carefully. Especially if storing customer's personal data.

    Here in the UK, we have the data protection act which prevents the abuse of customer's data; I don't know if there is anything similar where you are, but if you are storing customer's data in a cloud based service you don't always know where it will actually be and therefore what the laws are and what can be done with the data once there. Many of these companies now offer geographic guarantees of where their cloud servers are based. As they are one of the bigger players, I suspect that Amazon will have this in place. A company I worked for half-joked about storing the data in Romania to get round data protection laws.

    The other question is do you need this? I don't know what you are building or what you expect the traffic level to be but a decently specified dedicated server can handle a lot of traffic. It is worth considering a dedicated server in a hosting company and maybe moving to an on demand cloud based service if you out-grow it. The t's and c's advice for the cloud still applies to choosing a dedicated server host.

    You should look at the cost / benefit of both in any case.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  8. #18
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    941
    Quote Originally Posted by elija View Post
    It's not just Amazon these days many companies offer a similar service. I'm not going to recommend a particular one but which ever you consider make sure you read their terms and conditions and privacy policy very carefully. Especially if storing customer's personal data.

    Here in the UK, we have the data protection act which prevents the abuse of customer's data; I don't know if there is anything similar where you are, but if you are storing customer's data in a cloud based service you don't always know where it will actually be and therefore what the laws are and what can be done with the data once there. Many of these companies now offer geographic guarantees of where their cloud servers are based. As they are one of the bigger players, I suspect that Amazon will have this in place. A company I worked for half-joked about storing the data in Romania to get round data protection laws.

    The other question is do you need this? I don't know what you are building or what you expect the traffic level to be but a decently specified dedicated server can handle a lot of traffic. It is worth considering a dedicated server in a hosting company and maybe moving to an on demand cloud based service if you out-grow it. The t's and c's advice for the cloud still applies to choosing a dedicated server host.

    You should look at the cost / benefit of both in any case.
    That's the thing I liked about using the Rackspace (RS) load balancing service, we had our physical servers hosted at local company so the only thing the RS knew was our IP's and rules sets for the load balancing. In early stages of our site using the load balancer make it easy to do testing and rollouts because we could switch servers instantly without DNS propagation time lag and switch back. It was the one thing I liked being a cloud service.
    A lion does not lose sleep, over the opinion of sheep.

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •