Skip to Content
Technical Articles
Author's profile photo Indu Sankar

Building a single code line multi-cloud application for Object Store

This blog gives a brief outline on how to build a single code-line multi cloud application consuming Object Store Service of SAP Business Teachnology Platform (SAP BTP), Cloud Foundry Environment

What is Object Store Service?

Object Store service enables the storage and management of objects, which involves creation, upload, download, and deletion of objects. SAP provides Object Store Service on its SAP BTP running on different IaaS providers like Amazon Web Service, Azure, Google Cloud Platform. Please click here for more information on Object Store Service.

Though the object store service is provided on multiple IaaS providers, the way to connect to and use the service varies for each IaaS provider due to changes in the structure of credentials and in the configurations . Writing a single code-line application that works seamlessly on all these IaaS providers is a challenge that many developers face.

We had developed a single code line reference application that can work  with Object Store Service on SAP BTP hosted on multiple IaaS providers . This application perform operations like upload, download, delete and list of files. It is a spring boot application that uses Apache jclouds library which provides a multi-cloud toolkit that gives a developer the freedom to create applications that are portable across IaaS providers.

Architecture diagram of the application

A single REST controller accepts the request (GET, POST, DELETE).

Separate service implementations, configuration classes are provided for each of the Object Store Service provider. The right implementation, configuration is loaded by spring boot based on the IaaS provider that the application is deployed on.

A single DAO (Data Access Object)/ repository class calls the jclouds API’s to perform upload, download, delete operations on the Object Store.

Source code and Tutorial

The source code and documentation of application is available on Github.

A detailed tutorial with steps on how to create such an application is also available.

Hope you will find the code and tutorial useful. Do post in your comments and feedback.

Happy coding!

 

 

Assigned tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Shilpa Gopalakrishna
      Shilpa Gopalakrishna

      Hi Indu,

      We have various other services to manage unstructured content like Document Service, SAP Document Center , Object Store. HANA on Cloud Foundry/SCP itself can store BLOB objects. How do i map between services and scenarios? What Use-case does each service solve that can't be solved by the other?

      Thanks

      Author's profile photo Manjunath Baburao
      Manjunath Baburao

      Thanks for the very pertinent question, Shilpa. Based on your question, we are planning to put out some information on the community in the coming weeks. I will update you once this is available.

      But in general, each of these services has a niche place on the platform for which it would be the right fit. More details soon.

      Author's profile photo Shilpa Gopalakrishna
      Shilpa Gopalakrishna

      Thank you Manjunath. Waiting for the comparison blog!

       

      Author's profile photo Chandramohan Sankaran
      Chandramohan Sankaran

      Cool blog... thanks for sharing

      Author's profile photo vijai mohan
      vijai mohan

      Hello,

      Thanks for the blog.

      My question is: Is it possible to create folder structures under the object store? My requirement is I need to have folders segregated and place right content under the right folders. Also to make it easy to access, is there any standard UI tool like file explorer available to browse through whats available in my object store?

      Author's profile photo Roopa Narayanaswamy
      Roopa Narayanaswamy

      Hi Indu Sankar ,

       

      Thank you for such a great blog.

      How will this work in a Multitenancy mode?

       

      Author's profile photo Indu Sankar
      Indu Sankar
      Blog Post Author

      Hi  Roopa,

       

      Thank you.

      There is no dedicated documentation for multi-tenancy with ObjectStore. However, you can create a bucket for each tenant on your side.

      Author's profile photo Roopa Narayanaswamy
      Roopa Narayanaswamy

      Okay, thank you Indu

      Author's profile photo Arjun Singh Thakur
      Arjun Singh Thakur

      Hi Indu,

      Per my understanding, when the service instance for Object Store on AWS is created, an AWS S3 bucket is created and the same bucket is used to store the files.

      So, if we run in this in multi tenant mode, then the service instance will be created in provider's subaccount only and not on consumer's sub-account. Hence there will only be a single bucket getting created.

      Can you please advise how can we create a different bucket for each tenant in a multi-tenant mode.

      Regards,

      Arjun

      Author's profile photo Indu Sankar
      Indu Sankar
      Blog Post Author

      Hi Arjun,

       

      You will have to create objectstore instance per tenant. To create that in runtime you can refer to - serviceManager documentation.

       

      Regards,

      Indu