Why Learning ORDS Shortcuts Understanding Software Development In 2024

Thumbnail: Why Learning ORDS Shortcuts Understanding Software Development

If you are tired of long tutorials and a maze of resources just to get started with a technology, you’ll want to check out my webinar February 14th at 12PM Noon ET 2024. In just ONE HOUR I will teach you everything you need to know to understand and confidently start building APIs to bridge your data and applications. This session is completely FREE. All you have to do is register here:

Learn How to Connect Your Data & Applications the Easy Way With REST APIs

One of the biggest challenges when you first start dipping your toes into learning about software development is how vast this ocean of knowledge is. Any concept you choose to dive into will have you brushing up against 5 more just to understand the context of the topic. Some of the core areas that are common to familiarize yourself with include:

  • Programming Fundamentals

    • The basic concepts of programming

    • Examples include: Data Types, Variables, Conditionals, Loops, Functions

  • Algorithms

    • Sets of instructions for performing a task or solving a problem

  • Data Structures

    • How you organize and store data in a program to access and manipulate it efficiently

    • Examples include: Arrays, Linked Lists, Stacks, Queues, Trees, Graphs, etc.

  • Web Development

    • Being familiar with HTML, CSS, and JavaScript is the basis of building responsive and accessible websites

  • Databases

    • Where your applications store and retrieve data from

  • Version Control

    • A crucial tool for managing code changes and collaborating with other developers

  • Testing

    • Learning how to effectively test your code through different methods such as unit and integration testing

  • Programming Methodologies and Project Management

    • Especially if you are interested in corporate software development, being familiar with programming methodologies such as Waterfall & Agile and concepts such as DevOps will help you better understand how software gets built on a team

 

While it’s common to see these topic swirling around blog posts, YouTube videos, and other resources for new and aspiring developers, there is a powerful concept that is less frequently discussed at the beginning, which can really accelerate your understanding of the entire software development process. This concept is Application Programming Interfaces (APIs).   

 

When I first started my journey in tech as a solutions engineer, my teammates and I had a lot of industry concepts thrown at us quickly during our Class Of Program for new college grads. Learning about APIs was like eating your vegetables; you knew you had to do it and it was good for you but it really was a struggle at first. As someone without a tech background in college, I found the topic unintuitive as I wasn’t comfortable enough with the surrounding concepts to properly visualize it at first.

 

So in this article I’m going to break down APIs clearly and simply, explain why it’s so important to software development, and show you how Oracle REST Data Services lets you easily build APIs to connect your data to and between your applications.

 

What Are APIs?

Let’s start with the basics. What is an Application Programming Interface (API)?

 

At its core an API is a way for different pieces of software to communicate with each other. One software component requests data or a service from another component, which then provides it. Think of an API like a transportation tube that carries capsules of information. Let’s set up an example scenario.

 

Let’s pretend I’m a world-renowned chef and my real-world coworker Layla is my boss. Layla would only accept the job if she could work from home but luckily we installed a state-of-the-art tube transportation system between the restaurant and Layla’s house so we can quickly send information packages from one location to the other.

This tube is really convenient. It allows Layla to send requests to me and for me to send responses back to her. Most importantly it is secure. We specifically constructed the tube between just our two locations so only Layla at her house and me at the restaurant can communicate back and forth. This is how APIs work. Layla’s neighbor can’t start requesting restaurant information from his house because he doesn’t have an API built between his location and the restaurant. He also couldn’t just start building an API himself to the restaurant, he doesn’t have the proper authorization. As soon as he tries to step foot on the restaurant’s property I would tell him “I don’t know you and you don’t know the secret password so no you cannot connect your tube to my nice restaurant and start asking me questions”.

What Are The Different Types of APIs?

There are two major styles of APIs:

  • REST: Representational State Transfer

  • SOAP: Simple Object Access Protocol

 

There are other styles out there but these are the main ones. Of the types, REST is the most popular. Roughly 94% of developers use REST and about 80% of APIs on the public web are this architecture.

 

REST APIs

REST is an architectural style and APIs created in this style are called REST APIs. In order for an API to be truly RESTful it must meet the following constraints:

  • Uniform Interface

  • Client-Server Separation

  • Statelessness

  • Cacheable

  • Layered System

  • Code On Demand (Optional)

 

If you are curious on the specifics of these constraints this is a good article HERE

 

REST APIs use a client/server relationship for communication based around HTTP (Hypertext Transfer Protocol). HTTP is the foundation of the Internet and simply a request-response protocol to enable communication between clients and servers. You might be familiar with HTTPS from looking at the full address of the websites you are on:

HTTPS is (Hypertext Transfer Protocol Secure) and encrypts normal HTTP requests and responses. These are the different HTTP Methods with the most commonly used being GET and POST:

  • GET

    • Request data from a specified resource

  • POST

    • Send data to create or update a specified resource

  • PUT

    • PUT, like POST, also sends data to create or update a specific resource with one key difference: PUT requests are idempotent.

      • Idempotent is just a fancy word that means no matter how many times you execute something, you’ll achieve that same result. So doing the same PUT request over and over will always achieve the same result (such as creating only one copy of a resource) while a POST request would have side effects in this scenario such as creating multiple copies of the resource

  • HEAD

    • HEAD requests are GET requests where the response body (the section with the actual requested info) is excluded. HEAD requests are helpful to test to make sure a GET request will work without having to send over all the data.

  • DELETE

    • Deletes a specified resource

  • PATCH

    • Updates parts of a specified resource

  • OPTIONS

    • Describes the communication options for a specified resource

  • CONNECT

    • Starts a two-way communication tunnel with a requested resource

  • TRACE

    • Used for diagnostic purposes. Returns the full HTTP request back to the requesting client

 

Using these methods, REST APIs perform CRUD (create, read, update, delete) operations on resources identified by URIs (Uniform Resource Identifiers)

  • A URI is a unique string of characters used to identify resources on the Internet

  • A closely related very well-known term is URL (Uniform Resource Locator)

    • A URL is a type of URI that not just tells you the name of the resource but how to get there. A URI can just be a resource with a name like talke.tech (or oracle.com) while a URL is always a name combined with a protocol like https://talke.tech (https://oracle.com)

To use some REST API examples in our tube scenario with Layla and I…

Layla could:

  • Request recipes from me with a GET request

  • Pass along a new recipe for me to add to my cookbook with a POST request

  • Or have me remove a poorly reviewed recipe from my cookbook with a DELETE request

SOAP APIs

Simple Object Access Protocol (SOAP) is a messaging standard that exclusively uses the XML (Extensible Markup Language) data type, whereas REST supports multiple data formats including JSON, YAML, XML, HTML, and plain text.

 

The SOAP message structure is broken up into the following elements:

  • Envelope

    • Defines the message and its beginning and end. Think of it like a mail envelope.

  • Header (Optional)

    • A location for defining application specific requirements such as authentication information

  • Body

    • Includes the actual request or response information

  • Fault (Optional)

    • Includes information about any errors that arise while processing the message

 

REST was made in response to SOAP’s shortcomings. REST is more flexible and lightweight whereas SOAP is stricter but allows for stateful operations.

  • Stateful operations mean that the server (me) stores information about the client (Layla) and can use this over a series of requests and operations.

  • With stateless operations, this information is not stored so every server client interaction is independent. This allows the message to be more lightweight and save on server resources and bandwidth. REST must be stateless. Due to the efficient nature of REST APIs, they are ideal when statefulness is not a requirement and really shine when building mobile applications.

 

While REST requires use of HTTP, SOAP is independent of transport protocol so along with HTTP you can additionally use others such as JMS (Java Messaging Service) and SMTP (Simple Mail Transfer Protocol).

 

What is Oracle REST Data Services (ORDS) and Why Is It So Helpful For Building REST APIs?

Now that we’ve gone through what APIs are let’s talk about actually building them!

 

Oracle has a tool called Oracle REST Data Services (ORDS) that makes building and providing REST APIs for the Oracle Database simple. Not only that, but they are secure and smoothly able to handle enterprise level requests.

 

Using ORDS is so easy that customers have been able to deliver applications and services 10-100x faster than their non-ORDS development teams.

 

The performance is also undeniable. ORDS is easily able to handle loads of 100,000 requests/minute with customers reporting response times in the range of 40-900ms.

 

So this is how ORDS works: Oracle REST Data Services is a Java application that you deploy on your application server or web server such as Oracle WebLogic Server or Tomcat. ORDS serves as both a builder and provider for your REST APIs. After your API is built, HTTPS requests on your application are sent to ORDS through your REST API and then your server, which manages the application’s database/s, routes the request to the proper database containing the information you are looking to retrieve.

 

You can create a REST API on the ORDS dashboard by following the menus and creating your API module, template, and handler which are the 3 components of an ORDS REST API. The handler is where you define your HTTP method (GET, POST, DELETE, etc.) and SQL statement. It is the verb/action part of the REST API. Handlers are organized by their template which can be thought of as the noun that the handler is performing an action on. Each template can contain up to one handler per HTTP verb (for example: one GET handler, one PUT, one UPDATE, etc.). A module is a logical collection of templates.

 

To see how these components are organized in a URL, we’ll take a quick look at an example from the “How to Build Powerful, and Secure REST APIs for Your Oracle Autonomous Database” LiveLab which has you building APIs with ORDS and can be accessed HERE

In a future post or video I’ll do a full walkthrough of building and using a REST API through ORDS.

 

How This All Will Help You More Quickly Understand Software Development

APIs are one of the most powerful and fundamental tools in modern software development. By learning the concepts at play here and practicing building APIs, you will accelerate your development skillset and instinctually be connecting your applications and data and improve the interactivity of your apps in no time.

 

Luckily, you don’t need to be an employee at a Big Tech company to get access to an Oracle Database and start training with ORDS. Oracle offers a Free Tier option for the Oracle Cloud where you can spin up an Oracle Autonomous Database for free and build REST APIs that connect to it.

 

You can learn more about Oracle Cloud Free Tier accounts HERE

 

And the self-guided workshop I briefly mentioned above, “How to Build Powerful, and Secure REST APIs for Your Oracle Autonomous Database”, is a great place to start working with ORDS. That can be found HERE

 

Once you finish the workshop you are free to continue working and tinkering with ORDS using your Free Tier cloud account.

 

As a pro tip: combining Oracle Autonomous Database, ORDS, and Oracle APEX (our low-code application development platform) is a deadly combination for easily seeing your APIs come to life in an application. Content on this from me to come in the future :)

Find this post helpful? I’ll be expanding on the topics I laid out here, walk you through building APIs, and give you resources to shortcut your API journey during my FREE webinar February 14th at 12PM Noon ET 2024.

Sign up now to reserve your spot:

Previous
Previous

REST API 101 Webinar Resources

Next
Next

SQLcl 23.4 Is Out! Here’s Everything You Need To Know and More