caching the results of database in one of your software applications?

Have you had results of database cache in one of your software applications? What are the advantages and the pitfalls developers must be informed when caching the results of database.

Please answer...


... thnks.

We have cached the results of database cache on the client side, partially (in tables and files on OS as well). But this caching is limited to data purely STATIC (which is no change under any circumstances).

Our application depends on a lot of static data and we managed to reduce 10% of band with this implementation network bandwidth.

We tried to use the cache for the not-so-static data client-side but had a lot of problems associated with updating the same thing if we came back this change.

On a side note, it reminds me of the cache of the client available in Oracle 11 g result.

http://download.Oracle.com/docs/CD/B28359_01/server.111/B28279/Chapter1.htm#FEATURENO06989

See if it helps you.

Tags: Database

Similar Questions

  • Model for caching the results of database queries?

    I am interested in the caching of certain common and slow query results in a cache consistency and would like some suggestions on models of 'good '.

    In this case you would use a cache next to the model to the data stored in the cache/database where all updates are written to the cache and the database using a XA transaction (we need to do it this way because there are certain requirements of coherence that are difficult to check (at least with correct performance) by using only the cache). We intend to use a "near cache" with a rear limited size.

    We plan to invalidate the "saved query result cache" as part of each transaction update (we have a few simple rules which determine what query results that must be discarded for each change).

    The part that is a bit tricky is to make sure that no application is perhaps underway while an update of the data related to the query is also underway where the invalidation might be carried out until the result of the query is inserted in result cache... I am not concerned about order of exact time between queries and updates that are ongoing at the same time, but must be 100% sure that no "outdated" information remains (or can be inserted!) in the cache after the update was signed...

    It is not enough to rely on the expiration of the time based on the result cache (I would have to set the time so short that the cache would not give a lot of improvement)

    I think something like the following:

    When you perform a query (which can already caching):

    1. do a dirty read against the result cache to determine if a query with the specified result already exists here - if so use it!
    2. If it is not found lock, a key with the specified parameter, and when the lock is obtained to check once more that there is still no value, if there now to unlock and use it!
    3. If there is still no value run the database query, save the result in the cache, unlock and use the result


    When you make a change using a XA transaction:
    Remove records from query results in the cache corresponding to the changes - this can be done without first checking if there is really no result for the parameter or not.
    I guess the stage of preparation of the transaction will lock the deleted records in the cache of query result preventing the invalidations and simultaneous updates...

    Everyone sees a few windows of vulnerability here? For example, it is possible that the cache owned by the XA transaction lock is released before the update of the database has finished (thus a request could be carried out against the old data and be stored in the cache after the invalidation have been performed) or what exactly the kind of problems that the XA protocol designed to prevent?

    An alternative I've been thinking about how to run the database query / caching the result would be to leave a store class hides (for query result cache) execute queries when no entries exist in the cache, but I don't know how I would change the locking protocol to make it work - can I still lock a cache by this type or component entry , or which would result in a block?

    Suggestions, thoughts etc. are much appreciated!

    Best regards
    Magnus

    Hi Magnus,

    Everyone sees a few windows of vulnerability here? For example, it is possible that the cache owned by the XA transaction lock is released before the update of the database has finished (thus a request could be carried out against the old data and be stored in the cache after the invalidation have been performed) or what exactly the kind of problems that the XA protocol designed to prevent?

    If the query is executed as you described and your application can take the same lock of keys to query before you update the data and only released the lock, once the transaction is complete, you can be assured that a query based on outdated information will not be cached after the transaction. If you want to be sure that no stale query results will be returned, remove the result cached outside of the transaction just before the validation of the transaction.

    An alternative I've been thinking about how to run the database query / caching the result would be to leave a store class hides (for query result cache) execute queries when no entries exist in the cache, but I don't know how I would change the locking protocol to make it work - can I still lock a cache by this type or component entry , or which would result in a block?

    I think that you can implement a class of dumps for query result cache that can be used to provide the appropriate locking device. If implemented correctly, I don't think that there is a risk of blocking.

    Kind regards

    Harv

  • Fix the activation parameters for caching the results of the customer? No performance gain

    I gathered and made every detail I could search. I use Oracle EE 11.2 g 32-bit on Windows 7 64 bit

    But despite I activate client caching result, I see no difference response API despite I have remote, connect to the server on LAN 1Gbit network

    I see > difference 1 sec only when you enable caching of server (2nd opening files 300% faster 57 dry-> 18 s) and 32 MB are cached for the opening.
    I don't know how to see the client_result_cache except the network traffic, detours, IO
    MEASURES_
    * 1.* I activated the parameter setting Statement Caching on the client and dbhome and set it equal to my ora.ini file OPEN_CURSORS (300) the registry as possible. And rebooted the system, of course.
    ---------
    HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > ORACLE > KEY_OraClient11g_home1 > OLED > StmtCacheSize
    HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > ORACLE > KEY_OraDb11g_home1 > OLED > StmtCacheSize
    -There is no standard oracle registry dir - probably cause its 64 bit +.
    -* 2 I have Super-activated all relevant SYSTEM parameters. 3 X the size necessary to be cached, FORCED cach, 100% of the result, 600000ms lag(10min)
    -------
    client_result_cache_lag... large integer 600000
    client_result_cache_size... great integer.100M
    ...
    db_cache_advice... chain... WE
    db_cache_size... large integer 0
    ...
    ... full object_cache_max_size_percent... 10
    ... full object_cache_optimal_size... 102400
    ... full result_cache_max_result... 100
    result_cache_max_size... big integer.100M-this is for caching wright + server
    result_cache_mode... chain... FORCE
    ... full result_cache_remote_expiration... 30
    session_cached_cursors... around... 50
    -Is everything OK? Why not better time response then?
    The LAN 1Gbit 1 customer is perhaps too fast anyway, and I should try via internet or something?

    Hope that you have an idea, I can't search to find or think of something.

    As said by John, SQL * Plus does not implement caching the result to the client. You write an application for OIC (or another application that knows the OIC calls appropriate to make) that implements the setting cache the result of the customer.

    Your test is behaving as expected.

    Justin

  • Caching the result of OSB: expiration

    Hello

    Anyone know if it is possible to replace the TTL value (defined at design time) of the result while deploying caching (using the example or WLST customization file?).

    Kind regards

    Mathieu

    or you can create a script ant with xmltask to find/replace the expression directly in your business service file.

    We also use it to add sla during deployment

  • Problem with CS6 installing on the new laptop - 'SN is ok, but your software is probably illegal.

    I have an urgent problem with the Suite Design Standard CS6 installation on the new laptop - comment: "SN is ok, but your software is probably illegal". Software has been disabled on the old laptop. Help, please. Thank you. Marek

    We cannot help with this type of problem on the forums. Serila number questions should be handled by the customer service: Customer Contact

  • Optimization of a script with caching the results of Get - VM

    Hi, the project I have been work on front, but another question.

    I create a menu driven interface to run common commands against multiple machines. The script reads the names of machine from a text file using Get-Contentand then use Get-VM to get the objects on which it operates.

    As the Get-VM cmdlet takes a long time to run, I'm looking for a way to "hide" these objects if they have already been retrieved, rather than have them each time.

    So, you need:

    Check if the objects have already been retrieved; If it is not she should get the objects of the VM, cache, and then continue with its operation. It should also check that the entry in the text file has not changed since the cache was created.

    I have attached the CURRENT script if you want a look.  Other suggestions to improve this last would be welcome.

    You can use the last write date of the input file to check if it has been modified.

    For this time you can use

    $strLastWriteTime = (Get-Item $strVMList).LastWriteTime
    

    Computer virtual objects can be stored in a table.

    Only read the VM objects even if you connect to another server in VC or TXT file has been changed.

    $arrVMList =Get-Content $strVMList
    $arrVMobj = Get-VM $arrVMList
    

    I tried to apply this in your script.

    I used a few global variables to store the required information.

    Take a look.

  • Movement of the directory and database of one montage to another point

    Hi all


    Good week end...


    I have a small request here to ask...

    I have mount point A and B.

    A mount point contains the file .profile for a database D1 and ofaroot, the oradata and lost + found for database D2.

    Mount point B contains all data in database D1.


    The task is to move the entire contents of A to B.

    I just need to know what modifications would be required. According to my understanding, I need to make the following changes:

    1. modify the file .profile for D1 and change it to the new mount point.
    2 do I need database shutdown D2 before moving on to the other mount point?



    Please comment on my understanding...


    Concerning
    KKukreja

    Hello

    + 1. Edit the file .profile for D1 and change it to the new mount point. +

    I do not understand why you want to move the file .profile. Each user of the BONE at the level of the UNIX has a .profile in his own House. You can simply change the default .profile of the user of the OS by using vi commands.

    + 2. Do I need to stop D2 databases before moving on to the other mount point? +

    Yes you are, but you will need to provide additional information on the database. You could create a D2 tar file and move to the new D1 mount point and unzip the files.

  • Browser is caching the result of HTTPRequest: S

    I have an XML external, filled with images.
    Today, I added 2 new images but my watch the old web,
    Looks like browser displaying old data due to caching.

    How to solve?

    If the xml is an asset to your home directory of the Flex project structure and exported, you should try the project under the Project menu of cleaning. If he is sitting, waiting on the server, which is obvious (broswer cache) is a double control value.,.

  • Enabled caching for a client database, applies to all clients on this DB?

    When I active result caching client for a specific database (mDBService) for example with [for the next restart of the mDBService] sql
    more [email protected]
    password
    ALTER system set client_result_cache_size = 50 M scope = SPFILE;
    This means any client that connects on that DB, (SQL Plus or other API) puts the results cached?

    So it is a command from the Service DB at any client connected to cache the results cause client_result_cache_size is enabled

    Published by: Goodfire George on May 27, 2013 14:25

    Well, you change a setting in database level, so that if a client to update its own session level settings, then Yes, all customers will see this db value.

    Nicolas.

    PS: I wanted to say that if this setting itself is not "editable", it can be overridden
    Read more
    http://docs.Oracle.com/CD/E11882_01/server.112/e25513/initparams026.htm#REFRN10287

    Published by: Gasparotto N on May 27, 2013 14:30

  • cache invalid result

    Hello

    Version Linux Oracle 11.2.0.1

    I understand the invalidation of the cache (RC) thatt result is at the level of the table.

    I did a simple test:
    create table customer (custno number, custname varchar2(30));
    
    Table created.
    
    
    insert into customer (custno,custname) values (1,'Customer_1');
    
    insert INTO CUSTOMER (custno,custname) values (2,'Customer_X');
    
    select * from customer;
    
    
        CUSTNO CUSTNAME
    
    ---------- ------------------------------
    
             1 Customer_1
    
             2 Customer_X
    
    commit;
    
    Commit complete.
    Now I invoke the result cache
    select /*+ RESULT_CACHE */ * FROM customer where custno=1;
     
    
    Execution Plan
    
    ----------------------------------------------------------
    
    Plan hash value: 2844954298
    
      
    
    -------------------------------------------------------------------------------------------------
    
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    
    -------------------------------------------------------------------------------------------------
    
    |   0 | SELECT STATEMENT   |                            |     1 |    30 |     3   (0)| 00:00:01 |
    
    |   1 |  RESULT CACHE      | ggb2vz6jcvcn5ajzqh406j3n85 |       |       |            |          |
    
    |*  2 |   TABLE ACCESS FULL| CUSTOMER                   |     1 |    30 |     3   (0)| 00:00:01 |
    
    -------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    
    ---------------------------------------------------
    
      
    
       2 - filter("CUSTNO"=1)
    
      
    
    Result Cache Information (identified by operation id):
    
    ------------------------------------------------------
    
      
    
       1 - column-count=2; dependencies=(SCRATCHPAD.CUSTOMER); name="select /*+ RESULT_CACHE */ * FROM customer where custno=1"
    Invoke the RC for the second query line
     
    select /*+ RESULT_CACHE */ * FROM customer where custno=2;
     
    
    Execution Plan
    
    ----------------------------------------------------------
    
    Plan hash value: 2844954298
    
      
    
    -------------------------------------------------------------------------------------------------
    
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    
    -------------------------------------------------------------------------------------------------
    
    |   0 | SELECT STATEMENT   |                            |     1 |    30 |     3   (0)| 00:00:01 |
    
    |   1 |  RESULT CACHE      | fc8t6svvz6whh0gc8vcaxrh668 |       |       |            |          |
    
    |*  2 |   TABLE ACCESS FULL| CUSTOMER                   |     1 |    30 |     3   (0)| 00:00:01 |
    
    -------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    
    ---------------------------------------------------
    
      
    
       2 - filter("CUSTNO"=2)
    
      
    
    Result Cache Information (identified by operation id):
    
    ------------------------------------------------------
    
      
    
       1 - column-count=2; dependencies=(SCRATCHPAD.CUSTOMER); name="select /*+ RESULT_CACHE */ * FROM customer where custno=2"
    OK, they are stored in separate result cache

    Now update the second row of this table in another session
    update customer set custname ='Customer_2' where custno=2;
    
    1 row updated.
    
    commit;
    
    Commit complete.
    Now ask custno = 2 from the first session
     
    select /*+ RESULT_CACHE */ * FROM customer where custno=2;
     
    
    Execution Plan
    
    ----------------------------------------------------------
    
    Plan hash value: 2844954298
    
      
    
    -------------------------------------------------------------------------------------------------
    
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    
    -------------------------------------------------------------------------------------------------
    
    |   0 | SELECT STATEMENT   |                            |     1 |    30 |     3   (0)| 00:00:01 |
    
    |   1 |  RESULT CACHE      | fc8t6svvz6whh0gc8vcaxrh668 |       |       |            |          |
    
    |*  2 |   TABLE ACCESS FULL| CUSTOMER                   |     1 |    30 |     3   (0)| 00:00:01 |
    
    -------------------------------------------------------------------------------------------------
    
      
    
    Predicate Information (identified by operation id):
    
    ---------------------------------------------------
    
      
    
       2 - filter("CUSTNO"=2)
    
      
    
    Result Cache Information (identified by operation id):
    
    ------------------------------------------------------
    
      
    
       1 - column-count=2; dependencies=(SCRATCHPAD.CUSTOMER); name="select /*+ RESULT_CACHE */ * FROM customer where custno=2"
    The same reference of result cache is still there. While this average that hiding is NOT overturned despite the updated row or I am doing something wrong here?

    Thank you

    Published by: 902986 on February 12, 2012 13:26

    Cache the result id is a hash value for the query that Oracle later lets you know if a query generates a result set that is already in the cache.

    When you updated the table the cached result has been marked invalid. Then, you run the same query for record 2 and Oracle has created a hash value for the query and the hash value is identical to the first, because the query is the same; in other words, the query itself axe to the same value. But the contents of the cache of results for this query have changed and replace the old content invalid.

    If you query the result the cache value you will get the new value that not since the old result set for your second query is not there anymore.

  • Another application on the ebs r12 database

    Hello

    I would like to know if I can create another user on the ebs r12 database.

    That's another application (not ebs).

    What are the risks?

    Is there an id doc on this subject?

    Thank you.


    It may not be available for that Oracle doc. But as a principle, why the unrelated database schema is created in the EBS database. This will add more load on the database of EBS, administrative effort. Let's say that your EBS database is down for maintenance, while the other application accessing this scheme does not require maintenance always, it will be down.

    concerning

    Pravin

  • Migrate the MS SQL database to vCenter PostgreSQL appliance

    It is possible to migrate from vCenter 5.5u1 uses the Microsoft SQL database external to vCenter device using the embedded PostgreSQL database? Thanks for your replies.

    Officially no, you need to deploy a new vCenter and move your hosts for the new vCenter.

    Take a look at this thread another for alternatives: https://communities.vmware.com/message/2401063#2401063

  • One of your filters uses a custom header that contains an invalid character.

    When I send an email, you receive the following error message:

    «One of your filters uses a custom header that contains an invalid character, such as ':', a nonprintable character, a non-ascii character or an 8-bit ascii character.» Please change the msgFilterRules.dat file, which contains your filters to remove characters not valid in your custom headers".

    It is followed by a message saying that the email was sent and saved despite the error.

    The problem occurred after the transfer to 10 Windows (from Win 7)

    I deleted all files msgFilterRules.dat and all filters, but the message persists.

    Any suggestions on what else to try?

    Thank you
    Ben

    Problem solved.

    After you delete all files/imap mail entries, the problem disappeared.

  • Save the results locally when the database is offline

    Hello world!

    I work to justify the implementation of teststand for automation of test on the company where I work, far it seems that is the way to go, but they are some of the senior management, hesitating on this subject. One of the things that will be great for us (he will give him a +) is the ability to store the results locally on the workstation, where the database is offline (failure of the server or client disconnected from the network), and once he returns, the data is transferred to the database.

    We want to use SQL server for the database. I thought creating a SQL Server express locally on the computer, so all of the results will always be saved in the station first, I tried to use the sql import/export wizard to import data from a sql server to another, but I did not find any way to do it automatically, we are looking for one of the solution of the box free of charge or regular very very cheap It will be installed on each workstation.

    Thanks for your help and congratulations!

    Abelino,

    You can take advantage of the new features in later versions of TestStand.  In 2012, and most recent, you can write raw results.  As said Dennis you could just always write raw results.  Then use the TestStand Offline results new treatment utility write those in the database: http://zone.ni.com/reference/en-XX/help/370052K-01/tsref/infotopics/offline_processing_utility/

    You can create a service or something to do.

    BTW - Plugins can run in its own thread.

  • Help with the query to select only one record from the result set in double

    Hello

    Please help with the query. Version of Oracle database we use is 10g R2.

    I have a vision that is duplicated IDS, but they are used across the different functions. See below examples of data. Please help me with a query to select only one record (based on ID regardless of the area) from the bottom of the result set of duplicate records. For what is the point of view is there unique records, given the combination of the fields ID, Org, DF, dry, Sub-Sec

    ID
    Org
    DF
    Sec Sub-Sec

    (163)CQCPDMCPDMHD(163)PCENGENGENG(163)CQASICASICIS8888TSTACTACTAC(163)TSHEHESW6789CQINFOINFOFOS6789PCSECSYSSECSYSINFO16789TSSECSYSSECSYSINFO29009PCBMSBMSBMS1

    My result set must eliminate the duplicate identifiers regardless of whoever we choose of the result set. (I mean without distinction Org, DF, s, Sub-s). My expected result set should be.

    ID
    DSB

    DF
    SEC
    Sub-Sec
    (163)CQCPDMCPDMHD8888TSTACTACTAC6789CQINFOINFOFOS9009PCBMSBMSBMS1


    Thank you

    Orton

    Hello

    This sounds like a job for ROW_NUMBER:

    WITH got_r_num AS

    (

    SELECT id, DSB, df, s, sub_sec org

    ROW_NUMBER () OVER (PARTITION BY ID.

    ORDER BY org

    ) AS r_num

    OF view_x

    )

    SELECT id, DSB, df, sub_sec s,

    OF got_r_num

    WHERE r_num = 1

    ;

    He is a Top - N query example, where you choose the elements of N (N = 1 in this case) from the top of an ordered list.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) to your sample data and the results desired from these data.  (I know that you said that you were a view selection.  Just for this thread, pretending it is a picture and post simple CREATE TABLE and INSERT statements to simulate your point of view).
    Point where the above query is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.  (I didn't quite understand the explanation above.  I don't know why you want to

    ID ORG DF DRY SUB_SEC

    --      ---     --      ---     -------

    1234 CQ DPRK DPRK HD

    and is not

    1234 IS CQ ASIC, ASIC

    or

    TS 1234 IT IT SW

    or

    1234 CQ ASIC ASIC HD

    )
    If you change the query at all, post your modified version.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: https://forums.oracle.com/message/9362002

Maybe you are looking for