DEV Community

Rahul Bhaskar
Rahul Bhaskar

Posted on

Gentle Introduction to Open Service Broker

Scenario(Hypothetical)

Suppose a person has a laying server with lots of space in it, and he wants to earn some money from it, and he has an idea in his mind. That is to provide a database(relational database) as a service, which means a person can come to him and ask him to give a chunk of storage to store his website's data.
Sure he can manually create customer's account in DBMS(say MySql). But it will be a tedious task for him to create an account for every person that is asking for database service. On top of that, he would have to manage all his customers' data. ie, how many are using his service, what plan are they using, their payment, and cater to customers' database delete requests.
For a person to handle all those requests is not humanly possible.

So what's the solution?
(spoiler alert) create a service broker

Let's define some terms related to Service Brokers in the context of above example.

Service: Datebase is the service.
Catalog: List of all types of services that you provide. Here, catalog will contain the database, as it's your service that you are providing.
Provision: Create an instance of your service that you provide. Here, create an account of requesting users in the database and allocate the required resources.
Binding: Provide instance information to the user and it can be anything credential, instance information, routing. Here, it will give you credentials to connect to your database.
Unbinding: does the reverse of binding, and only valid for bindable service.
Deprovision: Delete the instance and associated resources. Here, the user account and associated resources will be deleted.

What is a service broker?

Think of it as a middle man between your customer and the service that you provide. It will automatically handle provisioning, de-provisioning, binding and unbinding, and status of all the services instances provisioned.

Formal definition

Service brokers manage the lifecycle of services, and platforms interact with service brokers to provision, get access to and manage the services they offer.

The most famous service broker that you have seen, is what driving the AWS website.

What is open service broker?

It's the open-sourced version of service broker.

How to get started

  • read open service broker specification on github (note: it's a must-do read to get started)
  • get started with python package openservicebrokerapi (note: use python package to help get started, as it generated all the boilerplate code. It was a lifesaver for my project)

My Project

Note: any help to make this post better, suggestions welcome.

Top comments (0)