Considering CUBA

Hi CUBA team, thanks for developing such wonderful RAD tools.

I have 2 projects coming in and I am searching for good RAD tools for them.

Project 1 is about storing and sharing questions, answers and files. The estimated concurrent users will be 100k on peak period.
a. Is CUBA suitable for this project?
b. I have read the application scaling topic and found the maximum servers in the image is webclient x 2 and middleware x 2. Is it possible to have like webclient x 30 and middleware x 25?
c. I have used mysql or postgresql in the past for simple web development. I have plan to use postgres-xl in this project. The main different for postgresql and postgres-xl is the create table ddl with distribute / replicate options. The dml such as select etc are the same as well as the JDBC driver. Is it possible for me to modify the generated table creation script with distribute / replicate options and run it from within CUBA studio?

Project 2 is abit complicated.

  1. user register - user info stored on main database
  2. user activate payroll module - database created for payroll module, payroll info stored in private database, database connection stored in main database
  3. user can have more than 1 payroll module activated because he own more than 1 company
  4. user activate inventory module in company A - database already created, but tables will be created.
  5. our initial plan is to use the same WAR to manage our main database and user’s databases. But, certain user might need to add additional forms or customize a form or more reports or the application behave differently (eg. instead of doing nothing after save, it actually redirect to another form for only this user). My initial plan is to host the same WAR into another server. But my friends suggested using WSGI plugin way like Adempiere or iDempiere. Same basecode but different plugin.
  6. Everything is web based but there are some user requested to customize a program or desktop client for printing convenience.

Extra question, we are going to resell project 1 to some other potential clients with the same codebase but with different database data. How do I do that in CUBA studio?

I wish to know will CUBA able to make both projects success? We have a team of 3 developers and more to come up to 7 developers for this 2 projects.

Thank you very much.

*CUBA means a country???

1 Like

Hi Adam,
Thank you for your interest in our products!

About your first project.
a. Is CUBA suitable for this project?
CUBA backend (middleware) is certainly suitable for such project. CUBA standard UI is targeted mainly to internal users and to standard components (forms and tables) so only you can decide whether it is suitable or not. I can only inform you that you will need about 500GB of the total Java heap memory to serve 100K concurrent users. It means at least 25 machines with 20GB heap each. But you probably already know this.
b. Is it possible to have like webclient x 30 and middleware x 25?
Sure. The docs show only 2 blocks on each tier but there are no technical restrictions for using more. Web client blocks do not communicate with each other, so they can be scaled horizontally without limits. Middleware blocks share some state through UDP or TCP, but again, there are no restrictions in adding more machines.
c. Is it possible for me to modify the generated table creation script with distribute / replicate options and run it from within CUBA studio?
You can modify generated DB scripts right in Studio when it shows new scripts before saving them. And you can modify the saved scripts before applying them on the database - they are located in the modules/core/db folder of your project.

About the second project.
If by the user you mean a client with a separate installation of your product, CUBA offers a mechanism of creating “extensions” which may be suitable for your task. Take a look at the docs and at this article.
6. Everything is web based but there are some user requested to customize a program or desktop client for printing convenience.
You can create desktop client from the same source code. It supports fewer visual components, but all basic functionality will work without additional effort.
As for using several databases in one application - we are working on it, see https://www.cuba-platform.com/discuss/t/attach-external-databases#comment-1068.

Extra question, we are going to resell project 1 to some other potential clients with the same codebase but with different database data. How do I do that in CUBA studio?
If your clients need to develop on top of your product and they need Studio (which is actually optional), they will have to purchase the per-developer license for Studio. Or you can include some amount of Studio licenses purchased from us into your product price.

*CUBA means a country???
The short answer is Yes. It was just an internal name for the project, but we decided not to change it when we went public. Anyway, we like it, and I hope nobody minds :slight_smile:

1 Like

Hi Konstantin Krivopustov,

Thank you for your reply. I like CUBA platform very much. I have developed few intranet webapp using Vaadin before and still maintaining it. I believe CUBA can help me more in the next projects.

I am planning to use CUBA for project 1.

For project 2, below is just my questions for confirmation only as the requirements are from my client.

  1. Said we have an simple inventory module and we have 3 customers activate it. Each customer inventory holding 100k serial number and will generate 10k transactions (purchase, movement and sales) later. Our client want to store different data in different database eg. Customer001Db, Customer002Db, Customer003Db. Let’s said if 3 customers are using the original version of inventory module. How do we dynamically generate 3 databases after they click Activate button in the vaadin interface? How do we connect to the customer’s db instead of our db when customer is using the inventory module? The example I can give is odoo.com (former openerp.com), it can create new database for each tenant and all tenants using the same server (codebase) but accessing different databases.

  2. If (1) can be done. In your reply, if customer 002 want a special customization, what we do is extend our core project and named it like inventoryc002 and deploy to the server. Am I correct? Our software overview is as below

business website - register, create company (new database), activate module (new tables)
-> module A (CRUD), module B (CRUD)…

Above is my client’s requirements, I am just finding a way or a tool to finish the project by asking here. Please treat it as normal questions. This is not features requests.

Thank you :slight_smile:

Hi Adam,
If I understand you correctly, you should have a separate “generator” application that creates databases and actual business applications upon request. The process can be as follows:

  1. The generator app creates a new empty database, copies a canned Tomcat with the business app (of required version or customization) to a new location modifying its configuration (ports, connection URL, etc.), and starts it.
  2. The business app creates database schema on start (this is out-of-the-box platform facility).
  3. The generator app waits a minute and redirects the user to the new app (or sends a link in email).

As for connecting to a newly created database from one running application on the fly, I’m afraid CUBA persistence layer is not suitable for this. As I said, we are now working on support for multiple databases in one application, but we presume that they all are connected from the start.

Hi Konstantin Krivopustov,

Once again, thank you for your advices.

Normally our workflow will be as below

  1. customer sign up a package (in our webapp project A)
  2. our staff receive the request
  3. our staff create the database (for webapp project B)
  4. customer login (in our webapp project A)
  5. customer click and redirect to the module (in our webapp project B), webapp project B will call webapp project A jaxws function getConnString in order to connect customerDB. All the coding and tables names are the same, except the connection string.

I think our client already familiar with odoo.com or openerp before. Thus he requested as below

  1. customer login (in webapp project A)
  2. customer activate module inventory
  3. database created
    a. webapp project A create database
    b. webapp project B create tables for inventory usage
  4. customer activate module payroll
    a. webapp project C create tables for payroll usage
  5. customer click module inventory and adding some products.

I think this project kind of hard to use JPA variant because everything must be settled before application server started. I have some idea below.

  1. create website
  2. create cuba inventory generator
  3. create cuba inventory module
  4. website create database
  5. website REST call cuba inventory generator with dbConnString to create tables
  6. website redirect customer to cuba inventory module / website REST call cuba inventory module with dbConnString while customer working on website interface

Or the easiest is to code the website to execute all sql scripts files that cuba generated but with different database names. Then REST call the inventory module with an extra parameter dbConnString (excluding db password as REST function will either get the password from a file or from website database).

Most likely this project will website and portal REST of cuba. And issue is as below

  1. same cuba project (compiled once and deployed once) but different database
  2. all cuba projects sharing same user table. <<< i am still reading to find the way to share user table across multiple project

Also there are some questions below

  1. We will need to read or write databases from other application like finger print access log or RFID scanning log. Generate tables classes from the database might be good but their primary key alot of time doesn’t use serial or UUID eg. multiple columns key. May be can I use ordinary JDBC connection to do that inside IDEA coding? eg. Customer click a button to list the data or Scheduler triggered to pull the data for processing?

I like very much that CUBA default PK is the UUID (am I right?) because i came from MS Dynamics ERP and used to the MsSQL GUID style.

Once again, thank you very much for the replies.

Hi Adam,
Regarding sharing the users between databases I would suggest using a custom replication. It can be based on a combination of an entity listener and a status field for the User entity, a centralized user database, and scheduled tasks that process modified users and transfer them to the centralized database and back through the REST API or by direct connection. Let us know if you need an assistance with using CUBA mechanisms.

As for arbitrary PK in external databases, this issue has just been resolved (see commit on GitHub), and will be available in the platform v.6.3. So you will be able to map CUBA entities to tables with any PK including composite without modifying them.

Hi Konstantin Krivopustov,

Thank you again for fast replying.

The framework is awesome and the studio is sweet.

Is the 1 year studio subscription is USD or Euro?

We are planning to start using CUBA for new projects starting from simple one.

Too bad multi databases feature is in September release. I think we have no choice but to use Tenant method with ClientId as found in Cuba Saas sample.

The project 2 that I have mentioned is actually similar to online ERP but the client started it on HRM and Payroll (kind like ERP modules but we are not doing ERP). I am thinking whether we create 1 project with all entities bundled inside or create 1 project per module? As each project has different user and security. What’s your advice?

While reading through blogs, cuba framework is complete and can do anything without studio. Does that means we can overwrite or calling functions from cuba framework within IDEA function? I am still reading cuba documentation. But may I ask whether we can call REST function to get data from deployed cuba project A within deployed cuba project B?

Hi Adam,

Is the 1 year studio subscription is USD or Euro?

The subscription is 389 USD per develper per year. It also includes access to Premium Add-Ons (Reporting, BPM, etc.). When the subscription expires, you can still use previously downloaded versions of add-ons, so the subscription is needed only when you are actively developing your application.

whether we create 1 project with all entities bundled inside or create 1 project per module? As each project has different user and security.

It depends on how these modules interact. Whether they use one database or separate (sorry if I missed it from your previous explanations), whether entities from one module refer to entities from another. If they use separate user lists and security settings, perhaps they should be separate projects.

cuba framework is complete and can do anything without studio

Exactly. You can do everything from a Java IDE (IntelliJ or Eclipse) and the command line. Studio just simplifies scaffolding and configuration tasks.

whether we can call REST function to get data from deployed cuba project A within deployed cuba project B?

Sure, this is exactly what REST API is designed for.

Hi Mr. Konstantin Krivopustov,

Thank you very much for helping up. I am very satisfy with CUBA platform through your explanation and watching or reading all materials on your website.

We have long searching for a RAD tool that can be easy to start, flexible to extend, open to customize (calling framework functions while studio features is on the way) and with scalability in mind. My role is switching to project managing, it’s really hard to maintain a team of programmer smoothly dealing with java enterprise programming with those Beans and JPA things. We are still using Vaadin and Zkoss at the moment, but I will start to subscribe and implement simple project then later expand my team on CUBA usage.

Once again, thanks for helping up.