Great slide deck on Colombo! there is a saying that the frog lives in the pond never knows the fragrance of lotus while the bee from the forest comes to savor it ;)
Tuesday, October 18, 2011
Friday, October 14, 2011
Why We need Multi-tenancy?
This is an expert from my paper, "A Multi-tenant Architecture for Business Process Execution" that was presented at 9th International Conference on Web Services (ICWS), 2011 with some changes to give context.
This is related to Sumedha's blog and Larry Elision's comment on Multi-tenancy (MT). Also similar ideas were presented in my talk at WSO2 Con Multi-tenancy: Winning formula for a PaaS.
What is Multi-tenancy?
The idea is that the same server instance can support multiple tenants. In other words, it gives the illusion to each user that he has his own server/App while actually, the server is shared among many. MT enables hosting organizations to mix and match heavily used and lightly used tenants together, thus enabling them to run the overall infrastructure with much less resources.
It is best compared to an apartment complex, where the owner of each apartment (tenant) thinks it is his own home, while the apartment complex shares resources like real state, plumbing, ventilation, security etc. Idea is to provide isolation while achieving maximum sharing.
Why Multi-tenancy?
1. Each VM runs its own OS etc., while with MT, the sharing happens at much higher level than VMs, thus enabling better resource sharing.
2. Supporting Pay as you go within a Cloud platform.
Let me explain this in bit more detail. Cloud platforms, SaaS, PaaS have “pay-as-you-go” model as a key assumption. That is users can ask for resources and use them only when he needs them and should be able to release resources when he does not. If this assumption holds, applications while not being used should cost the user almost nothing. Therefore, to support pay-as-you-go model, the both SaaS or PaaS middleware should be able to support applications owned by many users (we will call them tenants) within the same server while allocating resources on demand.
It is possible to do this through IaaS where one can run a VM per each user. However, often many of the applications and users are not active (in use). For example, if a hosting provider has 10,000 tenants and if only few hundred are in use at a given time, then running a VM for each is a waste. Since booting up a VM often takes time and does not complete fast enough to serve the first request, keeping VMs in disk and booting VMs on demand is often not practical.
With MT, the cloud provider can handle this by allocating tenants to servers based on the projected load (e.g. cloud provider can give different classes of QOS). He should place many rarely used tenants in the same server using MT, thus reducing the cost.
However, there may be other way to implement pay-as-you-go, and I would love to hear about them.
On final note, implementing MT is not easy by any means, and it take some thinking and hard work. Main challenges are data isolation, execution isolation, and performance isolation. I will talk about them more in a later blog. Mean while, following papers talks about how WSO2 implemented some of them.
- A. Azeez and S. Perera et al., WSO2 Stratos: An Industrial Stack to Support Cloud Computing, IT: Methods and Applications of Informatics and Information Technology Journal, the special Issue on Cloud Computing, 2011.
- Milinda Pathirage, Srinath Perera, Sanjiva Weerawarana, Indika Kumara, A Multi-tenant Architecture for Business Process Execution, 9th International Conference on Web Services (ICWS), 2011
- Paul Fremantle, Srinath Perera, Afkham Azeez, Sameera Jayasoma, Sumedha Rubasinghe, Ruwan Linton, Sanjiva Weerawarana, and Samisa Abeysinghe. Carbon: towards a server building framework for SOA platform. In Proceedings of the 5th International Workshop on Middleware for Service Oriented Computing (MW4SOC '10). ACM, New York, NY, USA, 7-12. DOI=10.1145/1890912.1890914 http://doi.acm.org/10.1145/
1890912.1890914, 2010 - Afkham Azeez, Srinath Perera, Dimuthu Gamage, Ruwan Linton, Prabath Siriwardana, Dimuthu Leelaratne, Sanjiva Weerawarana, Paul Fremantle, Multi-Tenant SOA Middleware for Cloud Computing 3rd International Conference on Cloud Computing, Florida, 2010
Monday, October 10, 2011
ICWS Paper: A Multi-tenant Architecture for Business Process Execution
Following are the slides for the paper "A Multi-tenant Architecture for Business Process Executions" that I presented at ICWS 2011 last July. The paper discusses in detail our work on extending multi-tenancy support to Business processes, and the discussed technology is now in used within WSO2 Business Process Server and WSO2 Stratos.
Milinda Pathirage, Srinath Perera, Sanjiva Weerawarana, Indika Kumara, A Multi-tenant Architecture for Business Process Execution, 9th International Conference on Web Services (ICWS), 2011
Abstract:
Cloud computing, as a concept, promises cost savings to end-users by letting them outsource their non-critical business functions to a third party in pay-as-you-go style.
However, to enable economic pay-as-you-go services, we need Cloud middleware that maximizes sharing and support near zero costs for unused applications. Multi-tenancy, which let multiple tenants (user) to share a single application instance securely, is a key enabler for building such a middleware. On the other hand, Business processes capture Business logic of organizations in an abstract and reusable manner, and hence play a key role in most organizations. This paper presents the design and architecture of a Multi-tenant Workflow engine while discussing in detail potential use cases of such architecture.
Primary contributions of this paper are motivating workflow multi-tenancy, and the design and implementation of multi-tenant workflow engine that enables multiple tenants to run their workflows securely within the same workflow engine instance without modifications to the workflows.
Thursday, September 22, 2011
Writing Your First Thrift Service
Thrift provides a Binary RPC protocol for supporting service invocations, and it provides toolkits to generate thrift binding for several languages, including Java, C, C++ etc. Then just like with Web Services, the thrift service invocations will agree on the wire and enable multiple programming language implementations to talk to each other.
If you remember CORBA, it was the same thing. Well except for the fact that it was nightmare to write a service using CORBA tools.
Well why am I interested with Thrift? Well simple answer is it is fast, and has lot of traction.
Luckily writing a thrift service is pretty easy. Following is how I did it.
If you remember CORBA, it was the same thing. Well except for the fact that it was nightmare to write a service using CORBA tools.
Well why am I interested with Thrift? Well simple answer is it is fast, and has lot of traction.
Luckily writing a thrift service is pretty easy. Following is how I did it.
- Download and build thrift from thrift.apache.org. Look at README for instructions. However, I had to disable Erlang binding while running ./configure ( --without-erlang).
- Then first step is to write the thrift IDL. Mine did looked like following. http://wiki.apache.org/thrift/Tutorial is the best source to learn how to write a Thrift IDL.
namespace java Test struct Tuple { 1: listtuples, } service Bissa { void put(1:Tuple tuple), list read(1:string pattern), list take(1:string pattern) } - The I ran thrift to generate code. Command looked like thrift --gen java bissa.thrift.
- Above created a service class and types define in the IDL. Then I wrote a server that uses the generated code and it looked like following. Sample class can be found from http://svn.apache.org/viewvc/thrift/trunk/tutorial/java.
//This is a class that implement Bissa.Iface interface (class generated by thrift to represent the service. ) BissaThriftServer handler = new BissaThriftServer(bissa); //then we initialize a processor passing that handler (implementation) Bissa.Processor
processor = new Bissa.Processor (handler); TServerTransport serverTransport = new TServerSocket(thriftPort); // Use this for a multithreaded server TServer server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).processor(processor)); System.out.println("Starting the simple server... on port "+ thriftPort); server.serve(); - Client looked like following.
TTransport transport; transport = new TSocket("localhost", 9092); transport.open(); TProtocol protocol = new TBinaryProtocol(transport); //following is generated code Bissa.Client client = new Bissa.Client(protocol); //now u have a stub, use it client.put(BissaThriftServer.createTuple("A", "B")); client.close() - You might also find this blog useful.
Saturday, September 17, 2011
Data, Data Everywhere and Challenges
I had the pleasure and privilege of moderating the Data Panel at WSO2 Conference 2011 that composed of the distinguished panel Sumedha Rubasinghe, C. Mohan, and Gregor Hohpe. Obviously, I did my homework for the panel and gave some thoughts on what to say. I felt at the end that I should write down the opening I did. So, here we go.
Let me start with a quote from Tim Barnes Lee, the founder of the Internet. He said, "Data is a precious thing because they last longer than systems". For example, if you take systems like Google or Yahoo, you will many who argue that the data those companies have collected over their operation are indeed the most important assert they have. Those data give them power to either optimize what they do or to go on new directions.
If you look around, you will see there is so much data being available. Let me try to touch on few types of data.
The paper, Miller, H.J., The Data Avalanche is here, Shouldn't we be digging? Journal of Regional Science, 2010, is a nice discussion on the subject.
Data do come in many shapes and forms. Some of them are moving data—or data steams--while others are in rest; some are public, some are tightly controlled; some are small, and some are large etc.
Thinks about a day in your life, and you will realize how much data are around you, that you know that is available; but very hard to accessed or processed. For example, do you know the distribution of your spending? Why it is so hard to find the best deal to by a used car? Why cannot I find the best route to drive now? the list goes on and on..
It is said that we are drowning in an ocean of data, and making sense of that data is considered to be the challenge for our time. To think about it, Google have made a fortune by solving a seemingly simple problem: the content-based search. There are so many companies that either provide data (e.g. Maps, best deals) or provide add on services on top of the data (e.g. analytics, targeted advertising etc.).
As I mentioned earlier, we have two types of data. First, moving data are data streams, and users want to process them near real time to either adopt themselves (e.g. monitoring the stock market) or to control the outcome (e.g. Battle field observations or logistic management). The Second is data in the rest. We want to store them, search then, and then process them. This processing is for either to detect some patterns (fraud detection, anti-money laundering, surveillance) or to make predications (e.g. predict the cost of a project, predict natural disasters).
So broadly we have two main challenges.
Representations
Let me start with a quote from Tim Barnes Lee, the founder of the Internet. He said, "Data is a precious thing because they last longer than systems". For example, if you take systems like Google or Yahoo, you will many who argue that the data those companies have collected over their operation are indeed the most important assert they have. Those data give them power to either optimize what they do or to go on new directions.
If you look around, you will see there is so much data being available. Let me try to touch on few types of data.
- Sensors – Human activities (e.g. near field communication), RFID, Nature (Weather), Surveillance, Traffic, Intelligence etc.
- Activities in World Wide Web
- POS and transaction logs
- Social networks
- Data collected by governments, NGOs etc.
The paper, Miller, H.J., The Data Avalanche is here, Shouldn't we be digging? Journal of Regional Science, 2010, is a nice discussion on the subject.
Data do come in many shapes and forms. Some of them are moving data—or data steams--while others are in rest; some are public, some are tightly controlled; some are small, and some are large etc.
Thinks about a day in your life, and you will realize how much data are around you, that you know that is available; but very hard to accessed or processed. For example, do you know the distribution of your spending? Why it is so hard to find the best deal to by a used car? Why cannot I find the best route to drive now? the list goes on and on..
It is said that we are drowning in an ocean of data, and making sense of that data is considered to be the challenge for our time. To think about it, Google have made a fortune by solving a seemingly simple problem: the content-based search. There are so many companies that either provide data (e.g. Maps, best deals) or provide add on services on top of the data (e.g. analytics, targeted advertising etc.).
As I mentioned earlier, we have two types of data. First, moving data are data streams, and users want to process them near real time to either adopt themselves (e.g. monitoring the stock market) or to control the outcome (e.g. Battle field observations or logistic management). The Second is data in the rest. We want to store them, search then, and then process them. This processing is for either to detect some patterns (fraud detection, anti-money laundering, surveillance) or to make predications (e.g. predict the cost of a project, predict natural disasters).
So broadly we have two main challenges.
- How to store and query data in a scalable manner?
- How to make sense of data (how to run the transformations data->information->knowledge ->insight)
Representations
- Supporting semantics. This includes extracting semantics from data (e.g. using heuristics based AI systems or through statistical methods) and supporting efficient semantics based queries.
- Supporting multiple representations of the same data. Does converting on demand is the right way to go or should we standardize? Does standardization is practical?
- Master data management – Making sure all copies of data are updated, and any related data is identified, referenced and updated together.
- Data ownership, delegation, and permissions.
- Privacy concerns: unintended use of data and ability to correlation too much information.
- Exposing private data in a controlled manner.
- Making data accessible to all intended parties, from anywhere, anytime, from any device, through any format (subjected to permissions).
- Making close to real-time decisions with large-scale data (e.g. targeted advertising). Or in other words how to make analytical jobs faster.
- Distributed frameworks and languages to process large data processing tasks. Is Map-Reduce good enough? What about other parallel problems?
- Ability to measure the confidence associated with results generated from a given set of data.
- Taking decisions in the face of missing data (e.g. lost events etc.). Regardless of the design, some of the data will be lost while monitoring the system. Then decisions models have to still work, and be able to ignore or interpolate missing data.
Tuesday, September 13, 2011
Multi-tenancy: Winning formula for a PaaS
Following is the slide deck I presented at WSO2 Conference today. It provides a detailed discussion on what is Multi-tenancy, why it is needed and details about potential implementations.
View more presentations from Srinath Perera.
Wednesday, August 24, 2011
NoSQL Now Talk:Finding the Right Data Solution for Your Application in the Data Storage Haystack
- type of Search needed by the application(Different Columns, colored Blue)
- amount of Scale needed by the application (colored green)
- amount of consistency required by the application (colored brown)
Here we are presenting 3D data using a 2D table. Repeated columns under each type of scale column sets takes care of that. For example, "DB" in the forth row forth column says "if you need where clause like search, with small scale and transactions, use a DB". Other cells use the same idea.
The notation I use is KV: Key-Value Systems, CF: Column Families, Doc: document based Systems. Questions marks in the table means, it might work, but you should verify. The table only put the recommendations and does not exactly say how I come up with the recommendations. More details are in the slides, and I will get out a writeup soon. Some of the key ideas are
- Transactions and Joins does not scale great
- KV scale most, then CF and Doc models, then DB. So if KV is good enough, go for that.
- Offline case have time to do MapReduce and walk through the data.
- If you need transactions or Joins with scale, you have to try partitioned DBs. But you have to try and see, and it might not work either. If it does not, you are out of luck.
Small (1-3 nodes)
|
Scalable (10 nodes)
|
Highly Scalable (1000s nodes)
| |||||||
Loose
Consistency
|
Operation Consistency
|
ACID
Transactions
|
Loose
Consistency
|
Operation Consistency
|
ACID
Transactions
|
Loose
Consistency
|
Operation Consistency
|
ACID
Transactions
| |
Primary Key
|
DB/
KV/ CF
|
DB/
KV/ CF
|
DB
|
KV/CF
|
KV/CF
|
DB?
|
KV/CF
|
KV/CF
|
No
|
Where
|
DB/ CF/Doc
|
DB/ CF/Doc
|
DB
|
CF/Doc(?)
|
CF/Doc
(?)
|
DB?
|
CF/Doc
|
CF/Doc
|
No
|
JOIN
|
DB
|
DB
|
DB
|
??
|
??
|
??
|
No
|
No
|
No
|
Offline
|
DB/CF/Doc
|
DB/CF/Doc
|
DB/CF/Doc
|
CF/Doc
|
CF/Doc
|
No
|
CF/Doc
|
CF/Doc
|
No
|
Subscribe to:
Posts (Atom)