2 Replies Latest reply on Mar 5, 2019 7:04 AM by Peter de Vaal

    ORDS vs Database Links


      Dear all,

      we are using oracle 12c databases.


      we have multi database environment. we are heavily using database links to communicate between databases for DML or select rows purposes.

      we are checking the possibility if ORDS can perform faster as we heard the REST can perform faster the Database Links.


      please guide us because we are planning enterprise-wide change. shall we continue using DB links or the ORDS will bring any performance or other impact to our enterprise?



        • 1. Re: ORDS vs Database Links

          I think you'd have to ID what the db_links are being used for


          if they're being used to push a LOT of data over a wide area, REST won't provide much relief


          and then, you're going to have to write some code to go from a db GET/POST HTTPS call back down to something useable in a SQL statement, which we've shared as an example before


          in other words, this isn't a simple question, and you're going to have to investigate this a bit on your own as well


          I would say REST enabled SQL via ORDS is another tool in the toolbox, not a silver bullet to kill db_links

          1 person found this helpful
          • 2. Re: ORDS vs Database Links
            Peter de Vaal

            The big difference between dblinks and REST is that the latter is stateless and non-transactional. That means there is no read/write consistency with REST. In most cases when dblinks are used the code relies on read/write consistency and two-phase commit, so replacing it by REST is not an option.

            If the dblink is e.g. used to get data from the other database to do validations, then when a change is made in the other database before you commit the validation might have given the wrong outcome when you use REST.

            When you use the dblink to write data to the other database you are more save, but in most cases REST would not perform better. The main difference is the overhead of establishing the connection to the other database. With REST you can make use of a connection pool, the dblink would need to make a connection on each call (but I guess that can be solved as well, ask a db expert).


            So, to replace dblinks with something that has the same behaviour (i.e. read/write consistency, two-phase commit) you need a service bus which calls services that use connections to the two databases which can do distributed transactions (with two-phase commit). This is all much more complex.

            1 person found this helpful