Create API layer over database - database

I have an on premise oracle database. Can I use anything on AWS e.g. API Gateway to query the database and expose the results via API? I know I could do API Gateway -> Lambda -> Oracle DB where the code in the Lambda function would query the database (assuming query takes less than 5 mins). Are there any other easy options that would be serverless and with minimal amount of code?
Basically I would like to find the simplest way to create an API layer over the top of an existing on premise oracle database so that applications (hosted on AWS) can access this data without connecting directly to the database. Does AWS provide anything out of the box?

There does not seem to be an out of the box way provided by AWS to connect API Gateway to your on premise Oracle DB. So basically the way you provided (API Gateway->Lambda->Oracle) should be the way to go.
Now the question is if you want to connect to your Oracle directly or if your want to create a replication of your database in RDS and create a synch mechanism between RDS and your on premise Oracle DB to keep the DB highly responsive and available (in case of network failure between AWS and your local network). I think that depends on how you access your DB on premise.
If your won't create an replica in RDS you should at least use a VPN connection to your local network to keep data transfer from on premise Oracle to AWS RDS secure.

Yes it is possible to use AWS Lambda and expose the API through API
Gateway. But that is the easy part.
The tough part is to get your On-Premise database connected to AWS
infrastructure. If you have an on premise database, and you are
working in a large enterprise, you will need to get through a lot of
approvals to setup a VPN or a AWS Direct Connect.
The ideal solution is to use AWS Direct Connect to extend your
corporate infrastructure to connect to AWS and then use Lambda to
connect to the DB.
Also there is no out of the box solution in AWS to connect to
OracleDB. At the most, you can wrap all business logic in Stored
Procedures, and execute them in the lambda function. You can always
use the JDBC from Lambda to connect and query your database.

Try this from AWS Marketplace https://aws.amazon.com/marketplace/pp/B01MU8W71L

Related

Real-time listening with MySQL server in AWS RDS

I want to create a MySQL instance on AWS RDS and provision a RDS proxy with it for handling lambda requests against the API calls through the API Gateway. I am quite new to AWS and this is the solution I found on the internet on how to best run a MySQL database on AWS. Please do correct me if this is wrong or I should try something better instead.
So anyway this is my setup I wish to carry on. I suspect that fetching data and performing CRUD operations through this will be easy. But I wonder how can I create WebSockets in RDS for a real-time chat feature in my application? Please guide me on how should I achieve this as I have not found any articles regarding this on the internet. Thanks!
You should use AWS API Gateway to create Websocket service not AWS RDS. Please check this resource.
RDS Proxy is one of the way to manage connections. Another solution is AWS Aurora Serverless but you need connect to database within VPC.
Maybe you can consider use serverless framework or chalice to make things easier.
If you want to invoke an AWS lambda function in your query, you can call lambda_sync or lambda async function.

On-prem SQL Server to Azure

I have 2-3 source systems which are on-prem databases. I am planning to use Logic Apps to connect to these source systems. As per the Azure documentation we need to install a On-Prem Gateway on a local computer.
I am skeptical of this methodology as it demands dedicated system, so not sure if this works in actual production scenario.
Please can you suggest what is the right way to do it.
Here is how to connect to on-premise data sources:
If the services are accessible over the internet then you call service endpoint over HTTP or HTTPS from azure logic apps. This article will help you with details steps to be followed: https://learn.microsoft.com/en-us/azure/connectors/connectors-native-http
If it is not accessible over the internet then this article will help with step by step process: https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-gateway-connection
Before you can access data sources on premises from your logic apps, you need to create an Azure resource after you install the on-premises data gateway on a local computer. Your logic apps then use this Azure gateway resource in the triggers and actions provided by the on-premises connectors that are available for Azure Logic Apps.
Also check this for reference.
You may also want to consider the costs.

Process data from on-premise SQL Server with cloud functions?

My client has his data stored on SQL Server hosted on an on-premise network. I established a VPN connection from Google to the network, but I don't know how to follow from here. My final goal is to process his data using cloud functions. Any suggestions?
PS: I read that Shared VPC can be used to accomplish this, but I don't have a proper organization for this purpose :/
Edit: I followed the suggestions on the comments but now I'm missing to extract the data since pyodbc is not pre-installed on Cloud Functions. Any ideas oh how to query an on-prem database on SQL Server through Cloud Functions?

How can I use a Azure Database for PostgreSQL in a Azure Logic App?

To simulate a device I want to use a Logic App to fill a Azure Database for PostgreSQL with test data.
I found the two connectors PostgreSQL and SQL server but unfortunately both don't work for me. The PostgreSQL connector does only support onpremise databases and neither the autodetection nor the manually input of the connectionstring works with SQL Server.
Would great if somebody could give me a hint how to write data into a Azure Database for PostgreSQL from a Logic app.
Unfortunately, there is no connector available for this as of today.
The current alternatives would be
Use Azure Functions (which can be called from Logic Apps if required)
Create Custom APIs and a Custom Logic App Connector
Also, there is a feature request on UserVoice that you may upvote to gain traction.

Azure on-premises data gateway - the way to go, or overkill?

When having some on-premises data sources that one wants to access from Azure, is the "best practice" to create a data gateway, or is this becoming an outdated approach? I ask because I notice it relies on the "Gateway Cloud Service" which as I understand it is on its way out.
The actual requirement for me is only to be able to do a query from a functions app to the on-premises sql server. I'm not even sure this is possible through the data gateway.
Any and all feedback appreciated.
Take a look at hybrid connections: https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
They are designed for what you want to do:
Basically, a tunnel is created between the SQL endpoint in your on-premise environment and a target endpoint for your Azure Function in the Azure environment. It uses HTTPS traffic, so it is easy on the on-premise firewall. To create the SQL endpoint, you'll need to install an agent called the 'Hybrid Connection Manager', which will act as a proxy between the Azure endpoint and the SQL server.
After the endpoints are established, you can connect to the Azure endpoint with your function, and it will be tunneled to the on-premise SQL (using the HCM).
Bear in mind that this will only work with SQL accounts, not with AD accounts. Also, the Azure Function must be hosted by a dedicated App Service Plan, not the consumption plan (alas).

Resources