Git Product home page Git Product logo

martinpankraz / sap-nodejs-on-cosmosdb-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 929 KB

Example project showcasing a resilient multi-region app on SAP BTP powered by globally distributed Azure CosmosDB

Home Page: https://blogs.sap.com/2023/01/27/sap-private-linky-swear-with-azure-global-scale-with-azure-cosmos-db-with-sap-private-link/

License: Apache License 2.0

JavaScript 34.79% Shell 3.45% EJS 61.76%
azure cosmos-db cosmos-sdk nodejs private-link sap-btp-cloud-foundry

sap-nodejs-on-cosmosdb-app's Introduction

Azure Cosmos DB with SAP Private Link quickstart sample

Example project showcasing a resilient multi-region app on SAP BTP powered by globally distributed Azure Cosmos DB. App was built upon the SAP Developer tutorial Create a Node.js Application via Cloud Foundry Command Line Interface and the SAP Private Link for Cosmos DB. It relies on Fastify instead of Express for a leaner setup.

This repos and associated πŸ“blog post shed light on the private connectivity aspect. To complete your resiliency journey, have a look at intelligent routing in this joint Microsoft+SAP Discovery Center mission and this blog post.

Getting started πŸš€

Create SampleDB from Quick Launch wizard in Cosmos DB on the Azure portal.

Create a SAP Private Link for Cosmos DB named cosmos-pls or rename service in manifest.yml

Run SAP Business Application Stuido or compatible IDE of your choice (I like GitHub Codespaces for ready to run environments).

git clone https://github.com/MartinPankraz/sap-nodejs-on-cosmosdb-app.git
cp templates/.env app

Maintain your cosmos credentials in the .env file. From Cosmos DB UI navigate to Settings -> Keys -> read-write Keys -> Primary Key.

cd app
npm install
npm start

Navigate to the addresses tab and enjoy the private response from CosmosπŸͺβ˜„️

Warning - when executing locally you need a connection to your SAP Private Link service (remember Cosmos is not publicly reachable!). Have a look here how to use ssh with cf.

Deploy to BTP πŸͺ‚

Adjust route in manifest.yml as per SAP's recommendation in step 2.

cf push

Full blown setup 🌏

This repos sheds light on the private connectivity aspect only. Learn more about intelligent routing in this joint Microsoft+SAP Discovery Center mission and this blog post.

architecture overview with emphasis on global deployment

Above architecture can be considered a mix of high-availability and failover concepts. How so? The SAP Private Link in each BTP CloudFoundry space is configured to be able to reach both Cosmos regions and the app layer responds to the end-user as per the intelligent routing setting (fastest, closest etc.).

Learn more about Azure IoT and Cosmos DB here.

Consider the ABAP SDK for Azure for additional interaction scenarios with Cosmos DB.

Learn more about available database spectrum for SAP Private Link scenarios

Note - Primary purpose of this Database comparison is to fuel your own investigation with no ambition to be extensive.

Lear more about choosing an API for Azure Cosmos DB here.

Database Type SAP Private Link enabled Hosted on BTP/customer’s Azure env Supported by SAP CAP natively
HANA Cloud Managed, closed-source, in-memory db service for relational, graph, spatial and document structures Not yet Yes/No Yes
PostgreSQL, hyperscaler option Managed, open-source object-relational db service No, but private VNet integration instead Yes/No No -- community offering hosted by SAP Mentors
Redis, hyperscaler option Managed, open-source in-memory data store for caching, streaming and message broker No -- private VNet integration instead Yes/No No
Azure Database for MySQL - single server1 Managed, open-source, traditional relational db yes No/Yes No -- community offering by Theo Sun
Azure Database for Maria DB1 Managed, open-source, traditional relational db yes No/Yes No -- community offering by Theo Sun
Azure Cosmos DB (serverless)2 Managed, closed source, NoSQL and relational database for modern app development, highly responsive, globally distributed yes No/Yes No, but in discussion with SAP Mentors and community
Azure Cosmos DB (provisioned throughput)2 See line before yes No/Yes No, but in discussion with SAP Mentors and community
Azure Cosmos DB for PostgreSQL Managed service for PostgreSQL extended with the Citus open source superpower of distributed tables Not yet No/Yes No, conflicts with PostgreSQL, hyperscaler option
Azure Cosmos DB for MongoDB3 Managed, MongoDB API compliant flavour of Cosmos yes No/Yes No
Azure Cosmos DB for Apache Cassandra3 Managed, Cassandra API compliant flavour of Cosmos yes No/Yes No
Azure Cosmos DB for Apache Gremlin3 Managed, Gremlin API compliant flavour of Cosmos, massive graph database service yes No/Yes No

1 General Purpose, Gen5 2 vCore

2 Request Units need to be understood for a proper comparison. Also paritioning strategy impacting number of requests.

Note: Check the SAP Estimator and Azure Pricing Calculator to get a ballpark overview on pricing details.

As you can see there is a variety of choice of data bases for your BTP app with different capabilities and implications. The associated blog post and prototype use Azure Cosmos DB for NoSQL in a multi-region setup with provisioned throughput.

Contributions and community work πŸ‘©πŸΌβ€πŸ€β€πŸ‘¨πŸ½

Follow this thread to stay up to date with CDS for Azure CosmosDB and SAP CAP driven by the amazing SAP Mentors. Feel free to comment under the associated blog posts or create issues here on GitHub.

sap-nodejs-on-cosmosdb-app's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.