<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jesus Brasero on Medium]]></title>
        <description><![CDATA[Stories by Jesus Brasero on Medium]]></description>
        <link>https://medium.com/@jesusbrasero78?source=rss-67bff16f561------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9-PUczDLtpjJhpbp.jpg</url>
            <title>Stories by Jesus Brasero on Medium</title>
            <link>https://medium.com/@jesusbrasero78?source=rss-67bff16f561------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:12:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jesusbrasero78/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[“MongoDB to Oracle Autonomous DB: How to Leverage the Benefits without Changing Code”]]></title>
            <link>https://medium.com/@jesusbrasero78/mongodb-to-oracle-autonomous-db-how-to-leverage-the-benefits-without-changing-code-a6be00908843?source=rss-67bff16f561------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6be00908843</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[autonomous-database]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Jesus Brasero]]></dc:creator>
            <pubDate>Fri, 16 Dec 2022 09:30:59 GMT</pubDate>
            <atom:updated>2023-01-10T13:49:00.056Z</atom:updated>
            <content:encoded><![CDATA[<p>Deploying a node.js application that consumes a MongoDB driver on Oracle Autonomous Database can be a straightforward process. This article will walk through the steps to get your application up and running without touching any code.</p><ol><li><strong>Configure Autonomous Database &amp; MongoDB driver</strong></li></ol><p>First, you must have an Oracle Cloud Infrastructure (OCI) account and access to an Oracle Autonomous Database. If you do not already have these, you can sign up for a free trial of OCI and create an Autonomous Database through the OCI Console. Remember that an Autonomous database is also included in the free tier (forever).</p><p>If it’s your first time, you can follow the <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/autonomous-provision.html#GUID-0B230036-0A05-4CA3-AF9D-97A255AE0C08">link</a> to provision it. Don’t forget to check the Always free configuration option (yes, free :-) ). Also, you should choose <strong><em>Secure access from allowed IPs and VCNs only </em></strong>in the network configuration section (mandatory to enable MongoDB driver). Add an Access Control Rule. You can add the IP where the node.js will run for demo purposes. Please follow the <a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/mongo-using-oracle-database-api-mongodb.html#GUID-35F8F2D8-0ACC-4809-91C5-2F4A16857F6E">link</a> to configure a specific MongoDB user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xk6sMcT5KO6HG4ckjwx4EQ.png" /></figure><p>You can find username, password, host, port, and database values in the OCI Console. Access to “Database Actions” in your Autonomous Database and click on “Oracle database API for Mongodb” in the related services section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*QvRdIJIXgq4md2pKFyh7Ww.jpeg" /><figcaption>Related Services section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*QxiFavAW9Cw715BBbc0oWg.jpeg" /></figure><p>Once you have these values, you can create your connection string and use it in your application to connect to the Autonomous Database.</p><p>Once your application is connected to the Autonomous Database, you can use the MongoDB driver to interact with the database. You can use the driver to perform common operations such as inserting, updating, and querying data from the database.</p><p><strong>2. Configure node.js application</strong></p><p>Once you have the necessary information to consume your Autonomous Database, you can use the provided MongoDB driver to connect to the database from your node.js application.</p><p>For instance, I want to reuse a node.js URL shortener.</p><p>Clone the project</p><pre>git clone https://github.com/nemo0/node-url-shortener</pre><p>Go to the project directory</p><pre>cd urlShortenerMongo</pre><p>Install dependencies</p><pre>npm install</pre><p>The driver can be installed via npm by running the following command:</p><pre>npm install mongodb</pre><p>Next, you will need to compose a MongoDB URI string that your application will use to connect to the Autonomous Database. This connection string will be in the following format (provided by Autonomous Database in step one):</p><blockquote>mongodb://&lt;username&gt;:&lt;password&gt;@&lt;host&gt;:&lt;port&gt;/&lt;database&gt;</blockquote><p>Define environment variables</p><blockquote>MONGO_URIMongoDB URI (e.g.: mongodb://&lt;username&gt;:&lt;password&gt;@xxxxxxxxxxxxxxx.adb.eu-frankfurt-1.oraclecloudapps.com:27016/mongodb?authMechanism=PLAIN&amp;authSource=$external&amp;ssl=true&amp;retryWrites=false)</blockquote><blockquote>BASEBase URL for Shortening (e.g.: http://localhost:3333)</blockquote><p>Start the server</p><pre>npm run start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*52Xg4Pt8VxY29Z8h9f5dfA.png" /></figure><p><strong>3. Test it</strong></p><p>Open your postman and test the API. Now you can copy the “shortUrl” value and check the redirection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DmHQgiWH2nTXaLCWpr9GVA.png" /></figure><p>Also, you can access your data from:</p><ul><li>MongoDB Compass. Provide the MongoDB URI and connect</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v1L9NcxbfFjLLF8_qrP3bA.png" /></figure><ul><li>Oracle Cloud. Click on “Database Actions” and “SQL”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SCqb4fXSiKpGn0wcX1cltA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*8MfX9wOdCtHiy9kxy94iSA.png" /></figure><p>Once here, select the user you have created, and your schema, also known as a database in the MongoDB world, will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7iFqDiBD_rpymQEeQX3yOg.png" /></figure><p><strong>4. Advantages of moving to an Autonomous Database</strong></p><p>Running your node.js application on Oracle Autonomous Database has several advantages. First, the database is fully managed, so you don’t have to worry about managing the underlying infrastructure or administering the database. This frees up your time to focus on developing your application.</p><p>In addition to the advantages mentioned above, one of the key benefits of deploying a node.js application on Oracle Autonomous Database is that you don’t need to change any of your existing code to make it work with the database. This is because Oracle Autonomous Database fully supports the MongoDB API, which means your application can continue using the same MongoDB driver and commands it originally wrote.</p><p>This means you can easily migrate your existing node.js application that uses a MongoDB database to Oracle Autonomous Database without making any changes to your code. This can save you time and effort and allow you to quickly get your application up and running on Oracle Autonomous Database.</p><p>Another advantage is that Oracle Autonomous Database is highly scalable and can automatically adjust its performance and storage to meet the needs of your application. This means that you can easily handle increases in traffic without having to worry about manually scaling your database.</p><p>Finally, Oracle Autonomous Database is highly secure. It uses advanced security features such as data encryption and user authentication to protect your data from unauthorized access. This ensures that your data remains safe and secure, even when running in the cloud.</p><p>Autonomous Database is designed to support different types of data, such as relational, JSON, or spatial data because different types of data are commonly used in modern applications and systems. So you can combine your data to provide the same infrastructure to all your applications, whether relational or not.</p><p>Using an autonomous database instead of a different database for each type of data content can make sense for several reasons. First, it can simplify database management and administration by allowing users to manage all of their data in a single system rather than having to manage multiple separate databases. This can reduce the time and effort required to administer the databases and help ensure that all data is consistently backed up and secured. Second, using an autonomous database can improve data interoperability and integration by allowing users to store and access different types of data using a standard set of tools and interfaces. This can enable users to quickly combine and analyze data from multiple sources and facilitate the development of applications that can access and use various data types. Third, using an autonomous database can improve performance and scalability by allowing the database to automatically optimize its resources and operations based on the specific needs of the applications and users that are accessing it. This can enable the database to provide high levels of performance and reliability, even as the amount and complexity of data grow over time.</p><p>Using Oracle Autonomous Database as the backend for your node.js application developed against MongoDB can provide many benefits, including ease of deployment, automatic scalability, and support for the MongoDB API without having to change any of your existing code.</p><p>If you’re curious about the goings-on of Oracle Developers in their natural habitat, <a href="https://bit.ly/odevrel_slack">join us on our public Slack channel</a>!</p><p>Thanks for your time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6be00908843" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>