<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    敬的世界

    常用鏈接

    統(tǒng)計

    最新評論

    J2EE object-caching frameworks

    Improve performance in Web portal applications by caching objects

    Web applications are typically accessed by many concurrent users. Usually, the application's data is stored in a relational database or filesystem, and it takes time and costs overhead to access these data sources. Database-access bottlenecks can slow down or even crash the application if it receives too many simultaneous requests. Object caching is one technique that overcomes this problem.

    Object caching allows applications to share objects across requests and users, and coordinates the objects' life cycles across processes. By storing frequently accessed or expensive-to-create objects in memory, object caching eliminates the need to repeatedly create and load data. It avoids the expensive reacquisition of objects by not releasing the objects immediately after their use. Instead, the objects are stored in memory and reused for any subsequent client requests.

    Here's how caching works: When the data is retrieved from the data source for the first time, it is temporarily stored in a memory buffer called a cache. When the same data must be accessed again, the object is fetched from the cache instead of the data source. The cached data is released from memory when it's no longer needed. To control when a specific object can be released from memory, a reasonable expiration time must be defined, after which, data stored in the object becomes invalid from a Web application's standpoint.

    Conventional methods for object lookup such as a simple hashtable, JNDI (Java Naming and Directory Interface), or even EJB (Enterprise JavaBeans) provide a way to store an object in memory and perform the object lookup based on a key. But none of these methods provide any mechanism for either removing the object from memory when it's no longer needed or automatically creating the object when it's accessed after expiration. The HttpSession object (in the servlet package) also allows objects to be cached, but lacks the concepts of sharing, invalidation, per-object expiration, automatic loading, or spooling, which are the essential elements of a caching framework.

    Middleware technologies such as EJB and CORBA allow the remote transfer of objects where the remote object is transferred between the client and the server. This type of access, also known as coarse-grained data access, minimizes the number of expensive remote method invocations. These data-transfer objects (also known as value objects) can be stored in the cache if the objects don't change frequently, which limits the number of times the servlet container must access the application server.

    More examples of object-caching uses follow:

    • Enterprise JavaBeans: EJB entity beans represent database information in the middle tier, the application server. Once created, the entity beans are cached in the EJB container, which avoids expensive data retrieval (resource acquisition) from the database.
    • EJBHomeFactorycache: If client applications don't cache the stub somewhere, then remote method invocation can become much more expensive because every logical call to the server requires two remote calls: one to the naming service to fetch a stub and one to the actual server. This problem can be solved by creating an EJBHomeFactory class to cache the references to EJB Home interfaces and reusing them for the subsequent calls.
    • Web browsers: Most popular Web browsers such as Netscape and Internet Explorer cache frequently accessed Webpages. If a user accesses the same page, the browsers fetch the page's contents from the cache, thus avoiding the expensive retrieval of the contents from the Website. Timestamps determine how long to maintain the pages in the cache and when to evict them.
    • Data cache: Data stored in a RDBMS (relational database management system) is viewed as a resource that is sometimes hard to acquire. A correctly sized cache is a crucial component of a well-tuned database. Most databases incorporate a data cache of some sort. Oracle, for example, includes a shared global area that contains a cache of recently used database blocks and caches of compiled stored procedure code, parsed SQL statements, data dictionary information, and more.

    How about data not fit for caching? Here's a list of data not recommended for caching:

    • Secure information that other users can access on a Website
    • Personal information, such as Social Security Number and credit card details
    • Business information that changes frequently and causes problems if not up-to-date and accurate
    • Session-specific data that may not be intended for access by other users

    ?????????changing application architecture diagram.jpg


    ????????????web porta caching-class diagram.jpg


    來源 : http://www.javaworld.com/javaworld/jw-05-2004/jw-0531-cache.html?page=1

    ?

    posted on 2008-10-04 19:44 picture talk 閱讀(189) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導航:
     
    主站蜘蛛池模板: 亚洲国产精品无码av| 亚洲国产综合精品一区在线播放| 亚洲高清国产拍精品26U| 夜夜爽妓女8888视频免费观看| 又粗又大又硬又爽的免费视频| 色偷偷亚洲第一综合网| 国产小视频在线观看免费| 国产亚洲情侣久久精品| 亚洲第一网站男人都懂| 成人免费777777被爆出| 亚洲免费视频在线观看| 午夜免费1000部| 久久精品国产亚洲αv忘忧草| 久久精品无码一区二区三区免费| 亚洲愉拍一区二区三区| 免费看香港一级毛片| 污污视频免费观看网站| 久久久久亚洲AV无码专区网站| 不卡视频免费在线观看| 91亚洲国产在人线播放午夜| 成人免费观看一区二区| 亚洲av成人片在线观看| 亚洲精品网站在线观看不卡无广告| 和老外3p爽粗大免费视频| 亚洲人成影院在线| 成人毛片免费视频| 免费无码又爽又黄又刺激网站| 亚洲精品无码久久千人斩| 1000部啪啪未满十八勿入免费| 亚洲av永久中文无码精品| 国产精品亚洲不卡一区二区三区| 久久午夜夜伦鲁鲁片免费无码 | 国产亚洲情侣久久精品| 亚洲第一AAAAA片| 成人无码区免费A片视频WWW| 羞羞漫画页面免费入口欢迎你| 国产成人亚洲综合无码精品| 999久久久免费精品国产| 丰满妇女做a级毛片免费观看| 亚洲综合视频在线观看| 免费国内精品久久久久影院|