Access to Stream's feed databases - getstream-io

Stream saves all the activities and follows on their databases in JSON format. However, I find the explorer provided in the dashboard unpractical and I'm wondering if I can access the databases externally, outside of the dashboard to make some integrations with aws services for example. So can I? And if not, is there any workaround so I can manage the databases more efficiently?

Stream is accessible, to insert and retrieve data, via a REST and realtime APIs, webhooks and Amazon SQS.
There are API Clients and Framework Integrations in various languages to help integrate Stream in your application.

Related

How to use MQL with node.js?

I have created a Monitoring Metrics Dashboard in my Google Cloud Console. The dashboard is working as expected, but since my app is highly dependent on those metrics, I was thinking about creating a schedule to see these metrics data and update the server accordingly.
After investigating the dashboards, I have noticed that there is an MQL query. Is there any way to execute this query in my node.js function so I can fetch the data and update the server?
You can try MetaApi https://metaapi.cloud cloud service which provides REST API and WebSocket API access to both MetaTrader 4 and MetaTrader 5 accounts.
Official REST API documentation: https://metaapi.cloud/docs/client
SDKs: https://metaapi.cloud/sdks (javascript, python and Java SDKs are provided as per April 2021)
It supports reading account information, positions, orders, trade history, receiving quotes, and accessing market data.
The service also provides copy trading API https://metaapi.cloud/docs/copyfactory and API to calculate forex trading metrics on a MetaTrader account https://metaapi.cloud/docs/metastats.
There is a case similar to yours in Stackoverflow (answered by user3666197).
And also you can easily connect your nodejs server in mysql. MySQL is one of the most popular open-source databases in the world and efficient as well.
Please follow Nodejs mysql tutorial for more details about the steps/process process of how to connect nodejs server to mysql.

Posting data to Salesforce from an Azure Function (Is there a connector?)

I've been searching for some time now for a way to interact with our Salesforce org easily through Azure functions and have been coming up dry. I guess where I am confused is that through Azure Logic Apps I can pretty simply connect into Salesforce and post data through them and I assume on their backend they must have some sort of built in connector to Salesforce.
Is this a package somewhere that I can utilize in Azure functions? This would simplify so much of what we are trying to accomplish with some of our integrations.
There isn't a built in Salesforce binding for Azure Functions, but one option you do have is to invoke your Logic Apps workflow from Azure Functions with the relevant payload, which would allow you to leverage all the built in connectors they have.
You don't really need any fancy connector.
For most use cases, you can use the Salesforce REST API:
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm
You can use Postman to test this API and get code samples which could easily be adapted to your Function App:
https://www.postman.com/salesforce-developers/workspace/salesforce-developers/collection/12721794-67cb9baa-e0da-4986-957e-88d8734647e2?ctx=documentation
But be careful!
Salesforce limits your API calls and it is very easy to blow these limits.
The naïve approach would be to post one record at a time. Instead, try to collect as many records as possible and post them all at once.
If Salesforce does not need the data immediately, you can build a cache that will store data somewhere else (e.g. a MongoDb) and then periodically forward the data to Salesforce after it has been allowed to accumulate to some threshold quantity and/or a certain amount of time has elapsed.

Azure - Cosmos DB integration with API Apps

Is there any integration between CosmosDB and Api Apps? I'm kinda new in Azure and I don't really understand which is the best approach.
My problem is that I am working on an IoT Project which gets data from the IoT Hub, passes it to a Function that sends it to the CosmosDB which then would need to be consumed by a Frontend. A pretty standard case.
I would usually create a backend to place between the database and the frontend but I really can't understand which is the best way to do it in Azure. Should I use the Api Apps or the integrated SQL Apis that are provided with CosmosDB? Are the Api Apps comparable to "containers" for my backend or do they have any other use other than keeping my code in a cloud machine?
Thanks a lot in advance!
You can't (well, shouldn't) have your frontend to directly call the database so you need a middle layer of some sort.
Creating an API could be one of the ways you go about it but based on your use-case, I would go with an HTTP Trigger Azure Function which would be the API that exposes the data.
You can then use the Cosmos DB Input Binding to retrieve the object you want to return and simply return the JSON of it.

Azure Api Management Join Payloads and to provide customer

I have a question about the use of the Azure Management Api. The architecture of the single responssabilidade Api predicts domain to perform the functions of the business area. See image structure.
enter image description here
1. I wonder if the Azure Api Management operates as a management or I have the possibility of using it as a Geteway add results of many APIs in one (
orchestrating) and available to the client that made the request?
2. The responsability to gather this data is the Web Application?
3. Is there a pattern?
Azure API management can do both, it started as a management tool, but has received some updates so it can act as a gateway as well.
Read about the different API managment policies you can create here: https://azure.microsoft.com/en-us/documentation/articles/api-management-policy-reference/
Or take a look at the advanced policies, with the control flow and the send request
https://msdn.microsoft.com/library/azure/dn894085.aspx
For an example of sending requests to gather information from multiple sources see this:
https://azure.microsoft.com/nl-nl/documentation/articles/api-management-sample-send-request/

Using Node.js for Azure Media Services/Handling Media Upload and Streaming

I am in the middle of developing services that will deal with media files (audio/video) . These services are responsible for uploading and then streaming media files uploaded by client (IOS, Android but not limited to these devices/platforms).
We are using node.js with mongodb as database. In the near future our services will be part of Azure. (Portions of our backend are already there in Azure)
In that case i came across Azure media services. I know that it does't have any sdk to work with for Node.js so my only option here is to use REST Service from Azure Media Services.
My question are:
1) Whats the correct approach adapted in this scenario by developers already handling this scenario. I am open for approaches/practices here and change what i am planning to do currently.
2)If i use Azure Media Services. How would my client calls my services (node.js) which acts as a proxy for calling REST Services for Azure Media Services. How will this exactly work and i have file in hand in my proxy to re-upload. Or i will internally direct my services so that internally it uploads to Media Services .
3)How these media files uploaded in media services are related to a record in MongoDB. Like a record can have multiple media files.
I appreciate any pointers/explanations here.
Thanks,
To proper answer your question there are few questions need to be answered.
1.What functionality are you going to provide on top of azure media services. From your question it seems that main goal to let users to upload asset and them to have ability to stream uploaded content.
For this purpose you need to have following steps to be implemented in node js.
Create asset and asset files records in Azure Media Service(WAMS) by calling REST API. http://msdn.microsoft.com/en-us/library/windowsazure/hh973617.aspx
Create access policy and locator which will give URI of blob storage where file needs to be uploaded. WAMS REST API
Upload file using node.js to blob storage http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/blob-storage/
Create encoding job which will encode you input into multi bitrate mp4. WAMS REST API
Package your multi bitrate mp4 to smooth or HLS format or utilize dinamic packaging feature in WAMs. http://channel9.msdn.com/Series/Windows-Azure-Media-Services-Tutorials/Introduction-to-dynamic-packaging
Once you ready to stream your content you need to give user client playback url pointing to origin server. In order to do this you have to call WAMS REST API and create origin locator
Assets are exposing ID and AlternativeID properties which you can use to map your metadata about content with WAMS assets and implement any additional Content Management logic.
You need to act as proxy if you have some user based authentication and don't want to have dedicate separate azure media account to one user. WAMS provides basic blocks for asset ingest, encode, package, ondemand delivery and in nearest future for live streaming.
It can be used as foundation for your cms system or you can act SSAS provider by adding additional authentication, authorization layer. Currently you can use third party offerings http://www.ezdrm.com/ for playback DRM protection or your own license server http://msdn.microsoft.com/en-us/library/windowsazure/dn223278.aspx.
I have a small solution but I think it will require some work from you, maybe you wont like it that much, how about working with Windows Azure Mobile services. it support adding NPM now, the reason that I am telling you to use the Windows Azure Mobile services is that it will help you connect to your clients whatever was the application platform used.
http://weblogs.asp.net/scottgu/archive/2013/06/14/windows-azure-major-updates-for-mobile-backend-development.aspx
to integrate between the .Net and Node Js you can start by using Edge JS or signalR I think.
http://www.infoq.com/articles/the_edge_of_net_and_node
http://www.asp.net/signalr
I just want to suggest an idea that might be helpful to work around the lack of support of Media services in Node Js is that you use Blob storage for streaming. after all the Media Services is based on the Blob storage I think. here is a link that will guide you with the usage of the blob storage.
http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/blob-storage/
here is also a question posted before about how to stream from blob storage using Node JS I hope you find it beneficial.
How to stream a Windows Azure Blob to the client using Node.js?
Getting contents of a streaming Blob to be sent to a Node.js Server
here is also another link that will help you to do so "Geo-Protection for Video Blobs Using a Node.js Media Proxy"
http://msdn.microsoft.com/en-us/magazine/dn198240.aspx
Just wanted to make sure that you got the Windows Azure Node Js SDK, you might find some solutions that can help you with the development of you application.
https://github.com/WindowsAzure/azure-sdk-for-node
I hope my answer helps you let me know if you need anything else.
I have more recent Typescript based samples now for AMS v3 API using our latest javascript Node.js SDK here
https://github.com/Azure-Samples/media-services-v3-node-tutorials

Resources