In this blog, I want to share my experience after having created many APIs using different approaches and technologies. I am going to encapsulate a simple process that will help you construct APIs, starting from scratch with an idea or requirement and move it all along to a happy consumption.
The best part of APIs is that they are microservices enablers, which implies that they are not technology prescriptive, so in this blog you will see that your APIs can be implemented using any technology or programming language.
I decided to use “Jokes” as the vehicle to explain the APIs construction best practices, mainly because jokes are a simple concept that anyone can relate to, but also because I want you to feel compelled to consume these APIs and by doing so, get a laugh or two.
My original idea with jokes is to:
- Get a random joke.
- Translate the joke to any language.
- Share the original or the translated joke with a friend via SMS.
This is the high-level view of how our end solution will look like:
Continue reading “Teaching best practices to Design, Build, Secure and Monitor APIs”
In this blog, I am going to show you how to get started with the Loopback framework to easily auto-build REST APIs in NodeJS and persistence layer in a variety of options, including relational and non-relational databases e.g. In-memory DB, MongoDB, MySQL, Cassandra, Oracle, etc.
In terms of API design and development, Loopback allows you to work “top-down” or “bottom-up”. I am going to cover both approaches in this blog.
First, we are going to create an API model definition in place, as we are building the REST APIs, this exercise will give us a Swagger-based API definition. Alternatively, we are going to start from an existing Swagger definition and use it to implement NodeJS REST APIs pointing to a persistence layer of choice (in-memory DB, MongoDB, MySQL, DB2, Oracle, etc.). I personally prefer the “API First/Top Down” approach, as it gives me the option to properly design and test my APIs first and then, simply move to implementation phase, but this ultimately depends on situations, preferences and requirements.
Continue reading “Teaching How to simplify building NodeJS APIs with Loopback Framework”
How to use the Thinxtra devices and Sigfox network with the Oracle IoT cloud service.
There are lots of activities happening today in the world of IoT (Internet of Things). The market is growing at a staggering pace. Oracle, of course, is providing services in this area, mainly to support our many great SaaS applications. Almost every application can benefit from data coming from devices on machines, automobiles, medical devices, human wearables and such. However, there are several issues people face:
- How to work with all the various devices.
- How to manage the devices and information.
- How to integrate these with other systems in the enterprise.
- Deployment of devices, configuration, maintenance, versions, upgrades, Etc.
Oracle IoT Cloud service is designed to help with these issues, but it is often overwhelming to get a given device’s data initially into the IoT cloud. Case and point is with the wonderful devices from Thinxtra which uses the Sigfox network.
Continue reading “Oracle IoT – Working with Sigfox/Thinxtra Devices”
Now days with the adoption of Serverless architectures, microservices are becoming a great way to breakdown problem into smaller pieces. One situation that is common to find, is multiple backend services running on technologies like NodeJS, Python, Go, etc. that need to be accessible via HTTPS. It is possible to enable these internal microservices directly with SSL over HTTPS, but a cleaner approach is to use a reverse proxy that front ends these microservices and provides a single HTTPS access channel, allowing a simple internal routing.
In this blog, I am showing how simple it is to create this front end with Nginx and leveraging “Let’s encrypt” to generate trusted certificates attached to it, with strong security policies, so that our website can score an A+ on cryptographic SSL tests conducted by third party organizations.
Continue reading “Teaching How to use Nginx to frontend your backend services with Trusted CA certificates on HTTPS”
The May 2017 update for ACCS (17.2.3) brought a cool new feature to ACCS, zero-downtime updates. While previously, there was support for performing a rolling restart of an application instance, where each instance would be brought down and updated in turn, this only enabled zero-downtime updates if you had an application running two or more instances, and your application could satisfy performance requirements with one fewer node. While any production system should be able to satisfy these requirements, many of the utility systems I ran were on a single node, and I had to send out an email blast to avoid being disruptive when I wanted to push a quick code fix.
Continue reading “ACCS Zero Downtime Updates and Re-Deployments”
Recently I was in Auckland, New Zealand running an Integration in Action workshop and I used Alexa to trigger some of my APIs, including some NodeJS APIs that I built to take off a drone. Some people found this interesting and asked me to write this blog to explain in detail how it works… So, here it is, I hope you find it useful.
There are multiple ways in which you can make Alexa to call your own APIs. Perhaps the most versatile way is by adding a new skill (see: blog 1, 2). However I found an even easier way to do so, and in order to achieve the MVP approach I have been attempting to practice in my day-to-day life, I took this simpler option, which is simulating a Phillips Hue HA bridge. By doing so, Alexa detects a new Home Automation (HA) device in “her” network range and accepts voice commands to easily “turn it on” or “turn it off” which you can then leverage to call your own APIs.
Continue reading “Teaching How to Use Alexa to Take Off your Drone using NodeJS”
Recently, I was challenged at work, to make my drone take off, using a simple voice command via “Alexa”. Given this challenge came from my boss, I decided to happily accept it. I ended up writing some simple NodeJS code that interfaces with my drone and used a series of new Echo skills and a Home Assistant bridge to easily command my drone to take off and follow simple orders, something like “Alexa, please take off my drone and make it back flip twice“.
After some hours and many coffees, I got to the point that I was done and ready to show my working demo. However, I needed to take my NodeJS code and put it somewhere in the cloud to run it. I had a few options, like deploying my code into Oracle Application Container Cloud Service, which runs NodeJS natively over docker containers, but given that I have done this in the past and I was in an “adventurous mode”, I decided to try something new.
I wondered how simple would it be to use Bitnami to spin up a new NodeJS VM in Oracle Public Cloud… Well, I was amazed how pleasant the experience was, so I decided to capture this excitement in a quick blog for you to try as well.
Continue reading “Teaching how to use Bitnami to deploy any Image into Oracle Public Cloud”