• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Service call optimization

 
Antonio Rafael Rodrigues
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody.
I’ve a doubt about my solution that has taken me a lot of time and I have got go through it soon. Then I’d like to ask for your help =]
First of all, I’m assuming that get information from the database would be less expensive and prone to risk than get it from the service. (Isn’t it a reasonable way of think?)
I have two scenarios:

1) Periodically, my system has to consult another system about some information that is accumulative (as a log), insert into the database and associate these logs to a report.
2) In other functionality, the user can see the logs that aren’t associate to any report yet. In this case, the system has to consult the service for the logs and show to user.
I was thinking if it would be worth, during the execution of the second scenario, insert the logs into database (without associating to a report). Then, when the first (that will always execute) or the second scenario to occur, the system wouldn’t have to get all the data again, it could ask to the service only the log information since the last update and get the rest from database (that was inserted in the last time that the second scenario occurred).

Finally I can summarize in advantages and drawbacks.
Advantages:
1. Shorter xml messages to transport (reducing network traffic) and to process (reducing processor usage) in each call to service (inside the two scenarios)
Drawbacks:
1. Increase the solution’s complexity.
2. Increase diagrams’ complexity.
3. May leave the functionality (the second one) slower, by executing a query (to get when the last update was made), inserting the results in to database, and consulting the rest of period from database too.

Well, what do you think? Am I going too far in my thoughts? Should I ignore this kind of thing and do in a straighter and simpler way? I don’t know if I’m exaggerating.
If it was a real work. I’d go for the more complex solution, but not before do some POC and collect more information. In terms of certification I’m not sure about this, mainly for the risk of loose points in complex diagrams
Sorry for the too big text.
Thank in advance for your thoughts.
 
Antonio Rafael Rodrigues
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another thought.

What about if a get all the logs from the other system every night. Always that the second scenario occurs, the system would get the information from the database.
In Use Case's description the expression used to describe the informations's update level is: "the logs to date" (Does it mean 'until this minute' ?).
I'm thinking on this for a week and I'm not sure if that is oversimplify the problem. Is it? I'm sure that it'd help to meet the capacity requirements, since the system could make all updates in a period of low traffic.

thanks a lot
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a database is likely to be faster. Your solution has an advantage of resiliency as well.

I recommend copying much of your post to a "design tradeoffs" or "assumptions" section. It is well thought out and good for the exam grader to know you thought it through.
 
Antonio Rafael Rodrigues
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jeanne.

What about that part where I said updating only at nights? I'm kind of confused about interpreting the expression "logs to date", as mentioned in the second post.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it is simplifying the problem. You still have all the technical pieces. You still have to communicate with the web service. And your solution is more thought out than "I assume the web service is always up and performant" which is what I think most people would do.
 
Antonio Rafael Rodrigues
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank again Jeanne. I'm very happy for reading that.

I think that I'm gonna do that way, document that the logs will be updated only at night, and the expression "logs to date" wil be limited to a daily update.

But I still would like to read another opinions to make my thoughts more solid. Anyone else?



 
Mike Degteariov
Ranch Hand
Posts: 145
8
Java Mac MySQL Database Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Antonio,

Do you know the scope of information for your nightly data synchronizations ?

Time (once a day) is just one dimension, is there any other dimensions ?
Does your system have a notion of a user, like customer or patient - If it does, are you going to copy the data related to all users ?

If you are only going to copy every night only some kind of a digest, or some small subset of data, then it is acceptable;
but I would object implementing a nightly copying (or "caching", or "synchronizing") of all data available thru remote API.

Granted, this would increase resiliency of your system, but would hurt scalability and maintainability.
Your will run out of disc space on DB partition before you know,
and having a full local copy of something already available is probably a bad solution.

In some scenarios it is not even technically possible, since you do not have the information about all users (or customers, or patients) upfront.


 
Antonio Rafael Rodrigues
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Mike,
Thanks for your reply.

Yes my system has all the users.
The data synchronization is full, but incremental, if the user generated only one log today, this is what the nightly rotine will copy.
My system need to has all this information, it's clearly stated in domain model. To attend at least the basic function, I'd have to get all this information monthly for each user.
And it's not exactly a copy, the data in my system is structured different from where I have to get.
 
Antonio Rafael Rodrigues
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I should think in some purge routine. I'm not sure if I'd have to specify this, or just make a assumption that it'd be done manually direct in the database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic