cancel
Showing results for 
Search instead for 
Did you mean: 

Local persistence Vs Remote persistence in SAP

Former Member
0 Kudos

Hi All,

Why we remote persistence instead of local persistence in CAF?

Can you please provide any scenario on the same?

In my application, am going to use non sap database.Which one i can go for?

Help me out.

Thanks in advance

Vani

Accepted Solutions (1)

Accepted Solutions (1)

former_member206397
Contributor
0 Kudos

Hi,

In a CAF project, we have two options for accessing data. If we want to access data from an external system, we need to use Remote Persistency. That means in your CAF project data will be accessed through CAF external service that may be SAP service or non SAP service.

We have three kinds of service in a CAF project - 1. Entity Service, 2. Application Service. 3.External Service. Entity service is related to CAF Local DB. So if you want to store data in CAF local DB then you will a use Entity service. Even if you want to Use External service and Entity service at the same time that also you can do here. That is called mixed persistency. At thet situation external service will be mapped with entity service. So here remote database and CAF data base both will be involved. If you want to use only remote persistency then you can only access remote service from application service dirrectly, not required to involve entity service that means you are not involving CAF local DB.

If you have more query please let me know.

Thanks

Chandan

Former Member
0 Kudos

Hi chandan,

thanks for your reply.

I have gone thru all these services related topics.

my problem is what to choose?

any pros and cons when using remote/local persistence?(any difference)

how can i give complex queries while using .local persistence?

My application involves complex queries.

In one thread it was given that local persistence is used only for storing data alone and remote is for involving CRUD methods.is it true?

this is the link /people/ashutosh.rastogi/blog/2006/11/24/when-to-use-which-caf-service

former_member206397
Contributor
0 Kudos

Hi,

There are two options for using service in CAF.

If you want to store data or access data from CAF local DB then only you will go for CAF Entity service. But you also have the requirement to write your custom business logic. You know that within entity service there are no area to write business logic. At that situation you need to involve application service also which will be wrapper of your entity service. Then within the application service you can write your custom business logic to interact with your CAF local DB.

So the scenarion will be like

Remote Data

--->

CAF External Service

->

Entity Service

->

Application Service

CAF DB

But if you don't require to use CAF local DB suppose all of your data will come from other backend system(such as R/3, BI, non SAP system) then you need not to involve CAF local DB so not require to use CAF entity service. Then you can dirrectily use that external service from application service and within application service you can write your custom business logic.

|Remote Data| --->| CAF External Service|->|Application Service|.

But as per SAP's recomendation if you want to access CAF service from out side of CAF (like as Web Dynpro), do not directly access entity service. Then you need to access through application service. That means if you have entity service then also you need to create appplication service as a wrapper of your entity service.

So now as per your requirement you need to take the decision. If you have any problem please let me know your exact requirement in details, I will try to solve it.

Thanks

Chandan

Former Member
0 Kudos

Hi chandan,

My application is all about idea submission,edit idea, search idea.

which one is most suited, remote persistence or local persistence?

Thanks

Vani

former_member4529
Active Contributor
0 Kudos

Hi Vani,

The thumb rule is if the business object you are using in the composite applications exists in backend then you should use remote persistance. Otherwise if it's not existing in the backend and a new business object created for your application then use local persistance.

Thanks,

Dipankar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vani

We can you either of the persistency i.e. Remote or Local persistency in CAF.

I will like to add something when to use which peristency:

Local Persistency : are the Entity Services that you made in the CAF Layer to save your data. The life cycle methods, CRUD are automatically generated for these, we dont hace to care about them. This type of persistency is used when you want to apply some business logic on this set of data and want to store in your local database i.e the WAS/CAF database.

Best Practice says that you only store that data in WAS DB that you are getting as an output from your calculation. If that database is already in the bacend than no need to save it, just save the reference of the backend to fetch the data later.

If the amount of data is large that it is advisable to store the data on some other Database rather than the local database, than comes the picture of Remote Persistency, it may be R3, Oracle, MySQl etc.

Remote Persistency: When you want to store the data to other database different form your local database i.e the WAS/CAF database.

Hope now it is clear.

Former Member
0 Kudos

Hi All,

I have decided to have remote persistence(mysql).

Thanks for your replies.

keep answering,

Thanks,

Vani