Idea of Performance

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
skbansal999
Posts: 3
Joined: Thu Jun 15, 2006 1:58 am

Idea of Performance

Post by skbansal999 »

Hello All,

I intend to use Aware IM for a system, where I expect about 30 business rules that will use at the most four joined tables. A custom program will send queries one by one and wait for the reply at the average speed of 20 queries per minute. I will also prefer to use Oracle 10g database server. Is this sort of performance possible or I have to think of some custom coding solution? Purchase of hardware with fast processor and large memory is not an issue, but any idea on specifications will be appreciated.

Thanks
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

20 queries per minute shouldn't be a problem, but obviously a lot depends on what sort of queries you are talking about.

The involvement of business rules also needs to be clarified.

In Aware IM running database queries does not involve execution of business rules as rules are only executed when data is changed, not when data is queried. The performance of queries largely depends on the performance of the underlying database (there is some overhead in the translation of Aware IM query representation into SQL representation, but this overhead is minimal). By the way, Aware IM does not support Oracle yet, but it supports MS SQL Server and MySQL.

When the data of the system is changed rules get executed. There is certainly a performace hit here as Aware IM executes its rule engine before it commits data to the database. 30 rules, though, should not incur any significant performance overhead.
Aware IM Support Team
skbansal999
Posts: 3
Joined: Thu Jun 15, 2006 1:58 am

Post by skbansal999 »

Hello aware_support,

Thanks so much for the prompt response. Please allow me to clarify a simplified scenerio.

This is an example of typical invoicing application. Invoice no., Date, Purchase price, Sales Tax, and Total amount are the fields in INVOICE table.
I am thinking (maybe I am wrong) SALES_TAX table wil have Purchase_Amount, Tax_Rate columns that will be 'configured'.

Then, we have Invoice Form developed in some sort of Web Form. User enters all the data except, the 'Sales Tax' field is returned from a Database Query against the SALES_TAX query (am I right here?)

The result from the query will be inserted in the Invoice and printed for the customer.

Various three scenerios are as follows:

A. The Business Rules on June 15 are:
Sales Tax = 5% if Purchase Amount > $1000
Two customers make purchases of $500 and $1500 against invoice no. 1 and 2 on 15th June. What is the Total amount?

B. Rules change on July 4 to the following:
The government declares Independence Day Tax Holiday.
Sales Tax = 0 for all Purchase amounts
Two customers make purchases of $600 and $1600 against invoice no. 3 and 4 on 4th July. What is the Total amount?

C. Rules change on September 1 to the following:
Government decides to increase tax rate
Sales Tax = 7.5% if Purchase Amount > $1000 ELSE Sales Tax = 2%
Two customers make purchases of purchases of $500 and $2000 against invoice no. 5 and 6 on 4th July. What is the Total amount?

This is a very simplified situation but for the purpose of discussion, there will be 20 invoices per minute and the computation of SALES_TAX can have over 30 rules (You know the government :wink: the tax may be different based on item purchase, county, your race etc. etc.)

Thanks in advance for your response.
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Hello skbansal999,

Generally, the performance will depend on several variables such as the number of rules, the amount of data in the database and the hardware used. From your description I understand that you are not going to store invoice data in Aware IM but rather use Aware IM to calculate sales tax on request from an external program. If this is the case, the amount of data stored in the database would be very small (such as tax rates, ranges, etc.) and should not affect the performance much. With 30 rules you mentioned, I would guess the desired 20 requests per minute should be quite achievable using any new, or at least recent, PC even with a basic specification.

You can easily test your scenario to see what the performance is really like. All you have to do is to configure an Invoice object with all the necessary attributes and add rules to calculate the value of sales tax attribute. Then, in the operation mode create an instance of object Invoice using New Object menu command from the standard operation interface. Make sure the logging is set to full and inspect the rule execution log after the Invoice instance is created. It will show you the rule execution sequence timed to milliseconds.

Keep in mind that the logging itself affects the performance, so in the operational system you would want to switch it off, or set to minimal level, which should further improve performance. Also, if you are going to use an external program to request sales tax value, and you do not intend to keep the Invoice instances in Aware IM, you can mark the Invoice object as non-persistent. In this case Aware IM will construct the instance and execute all the rules as required, but will later discard the instance without saving it in the database.
Aware IM Support Team
skbansal999
Posts: 3
Joined: Thu Jun 15, 2006 1:58 am

Post by skbansal999 »

Hello Aware IM support,

Thanks so much for the clear explanation that you provided. I want to complement you for taking the time to under my requirements and then respond with the most comprehensive details, I have ever seen from a Support team. Kudos! You have just convinced me to be your customer.

Your last paragraph is right on the money in assuming that I'll use an external program to request sales tax value. A couple of questions here:
1. Can I use the standard JDBC, ODBC calls from the external program that is requesting sales tax value? I wish you had Oracle support, then I would have used PL/SQL program with remote database connection.
2. Why did you advise to mark the Invoice object as non-persistent. I thought that to improve performacne, it will be better to keep the object in memory so that the next query does not have to recreate the object with new parameters. All the new query should do is just to pass the new parameters to existing Invoice object instance and retrieve the result.
3. I understand that Aware IM will create its own database tables with appropriate attributes. But, what if I have the database already created? Is there a way I can connect Aware IM product to my esisting database instance? Otherwise, Aware IM will have its own instance and the DBA will have to manage two instances.

Thanks in advance.
Sushil
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Hello Sushil,

1. You cannot use JDBC/ODBC because you need to call Aware IM, not the underlying database, so it can perform the required processing. Aware IM supports Web Services as a standard communication protocol. If for any reasons you cannot call Aware IM using Web Services, you can write a custom channel in Java and plug it into Aware IM. On the Aware IM side all you have to do is configure a Service to create an instance of object Invoice. Please refer to Aware IM User Guide for details on using a Service.

2. The persistence option indicates whether object instances are stored in the database. Once a transaction is finished, Aware IM removes all object instances from memory, whether they have been persisted or not. It would be better to make object Invoice non-persistent for two reasons. First, if you do not intend to keep invoice data in Aware IM there is no need to store it in the Aware IM-managed tables. Second, it would improve performance as there would be one less database interaction. Creating a new object instance in memory is very quick and any impact on performance should be negligible.

3. Yes, if you use MS SQL Server or MySQL you can set up Aware IM to use the existent instance. Please refer to Installation Guide for details.
Aware IM Support Team
Post Reply