hi all,
I need some high level and efficient ideas on how caching should be
designed in the scenario below. The application and the cache will most
likely be in VB.NET.
I have a central interface (does not necessarily have to be a website)
that customers will access. This interface would connect to a load
balancer, which would then randomly choose one of N servers. Those
servers would run the same exact copy of an application (not yet
developed). This application provides some kind of service to the
customer, whatever that may be. These servers get/save data from a
central database server.
Diagram:
Customer -> | Load Balancer |
-> Server 1
-> Server 2
-> Server 3
->...
-> Server N
The database server contains settings that the application needs to run
as well as customer information.
Use Case:
When a customer attempts to access the interface, the load balancer
would randomly pick a server and the app would get the required
information from the database. The non-volatile customer information
would be loaded into the memory of that server and the volatile
information will be grabbed from the customers input. The customer does
what he/she needs to do and disconnects. The nonvolatile customer
information should be stored in some kind of cache.
Let's say the customer reconnects and happens to connect to the same
server. Since the nonvolatile data can be taken from the cache, the
application would run much faster than if it was to query the database
for it.
Question:
What if the load balancer happens to choose another server when the
customer reconnects, but to another server? How would we be able to use
this cache? Obviously I don't want each individual servers to query the
central database if this can be avoided. Some ideas I came up with is
have the servers query each other for the information, but this might
cause network traffic and I don't know how efficient this would be if
several hundred customers connected at the same time.
Please help!