kbghost

I want to use SOA to architect a software project of mine. There will be a web project and an application that share the same function calls in the data layer. So thinking this, I thought about designing this project using SOA. Problem with this is speed. If I want the website to be as fast as possible, SOA doesn't seem like the answer. Each call will take much longer then a direct db connection. So I began considering different solutions.

One solution to this is by creating two distinct business logic layer libraries. Those functions who's calls to the db are unique to the web project will be called using a direct db connection, while those shared with application will be called via web service. The problem with this is that code redundancy is a potential problem. It's easy to see how a function called via web service can also be on the library with the web project.

Second solution is to have one library that serves for the business logic layer, meaning there's two ways of accessing the same library, either directly on the web project or through the web service. This also is a problem because it takes away the advantage of the web service if someone access the function improperly, ie directly rather then via web service. It also creates two copies of the same library.

I'm really confused on how this should be architected, any advice or suggestions


Re: Architecture General SOA architecture question

V1.0.0.0

What is the deployment view of your system.... Are you restrained to any deployment scenarios or do you have to create everything from scratch



Re: Architecture General SOA architecture question

kbghost

Everything is being created from scratch. Working on what is the best way to architect this system.




Re: Architecture General SOA architecture question

V1.0.0.0

Have you been able to logically partition your business functionalities. I would suggest starting from a detailed requirement spec and then moving on to develop Use Case scenarios for the logical flows in the proposed solution. This way you would have a better toolset repository to start with and it would also help you at later stages of the project to back track design/implementation to individual use cases.

Also, logically partitioning the business entities and flows would give a clearer picture as to how the different modules comprising the solution can be permuted amongst themselves for creating different solution profiles.





Re: Architecture General SOA architecture question

kbghost

I'm sorry, I don't understand how that answers my question. I believe the question is not as low level as your answer. My question is a very high level question that entails architecture of layers rather then the modularization of the business logic layer. And suppose I do modularize the business layer, how should the divisions be split That was my original question of whether or not the layer should be split into two libraries or remain as one project.

Perhaps you could explain in a little bit more detail




Re: Architecture General SOA architecture question

Ollie Riches

As V1.0.0.0 is hinting at I think you need to do some analysis what you are trying to achieve before deciding whether or not to use an SOA approach:

What type of system are we talking about

What type of load can the system expect

How volatile is the data etc

Are there any peformance requirements

The list can go on and on...

HTH

Ollie Riches






Re: Architecture General SOA architecture question

Jackson McCann

Going back to basics here. Firstly why do you want to use SOA What problems will SOA solve, what benifits will it bring to you I'm struggling to see any benefits for this approach in the simple environment you are working in. Secondly you seem to be equating a web service based approach with SOA, web services are one possible way to implement a service but they are not the only way! I don't understand your reservations about your second solution, you build 1 library that implements your services and defines the interface too them, you then build a second library that exposes the services from the first library as web services (if that's what you want!). It does not matter which version someone calls - the service will perform the same actions in each case since the service logic only resides in one place.

For this type of application I'd look at using something like Deklarit http://www.deklarit.com/ it will generate a rules based data access layer for you and will also generate a web services interface to the data. (It also does some really nice things like creating and maintaining the database structure and reverse engineering from an existing database -although like everything in this world it isn't perfect) You will end up with a distinct data access layer, business rules layer and web services layer which is as much of an SOA architectre as you seem to need.

Hope this is off some help and not two waffle/rambling.






Re: Architecture General SOA architecture question

kbghost

ok, I think I am beginning to see where you are going with all this. The reason I wanted to use web services was that I started seeing an application and website sharing very similar functionalities. To prevent code redundancy, I was thinking I should do a web service so they can share the same business logic. Is this not enough of a reason

But your questions got me thinking whether or not I should do it at all. Doing some research reaffirms that as it seems like this is not the appropriate architecture for my project. Question, it seems that web services are used in large parts to open up a system to the public. If one were to have no intentions making the service public, is this more reason NOT to do web service

Thanks for all your responses. I really appreciate all the questions, I am beginning to agree that maybe I haven't thought it out as completely as I originally thought. And thanks a lot for the link! I definately will have to check it out. Smile




Re: Architecture General SOA architecture question

LivetoCodeCodetoLive!

There are 2 main problems mentioned in this post:

1. Should you architect the application using SOA:

You should use an SOA architecture if you are going to call the Business and Data Access Layers from other applications, and your application will be part of a larger enterprise environment.

A great place to start understanding SOA is through Ron Jacobs excellent webcasts on Patterns and Anti Patterns of SOA:

http://channel9.msdn.com/ShowPost.aspx PostID=259342

http://channel9.msdn.com/ShowPost.aspx PostID=260161

Make sure you listen to both of these and the SOA picture will be much clearer.

2. Speed and performance:

  • If you use WCF you could configure the services to communicate using TCP binary protocol inside the intranet and http on the internet.
  • You could optimize your services also by using application pooling on SQL Server and IIS and Caching for lookup data that does not change often.
  • Proper database indexing and paging data is also a great way to optimize application performance.






Re: Architecture General SOA architecture question

Udi Dahan The Software Simplist

First of all, SOA is not a kind of application architecture. If your application/system needs to run in an environment with Services, then SOA will impact how it is designed. However, in and of itself SOA does not entail exposing things as web services. If you're looking for more information on SOA, I have a bunch of articles up on my site: http://udidahan.weblogs.us/category/soa/.

For your scenario, it sounds like you should just use the same DAL in both projects. If you have certain security restrictions which do not allow you to access the DB from your client that won't work and you will have to go to a middle-tier first.

Hope that helps.






Re: Architecture General SOA architecture question

LivetoCodeCodetoLive!

SOA is a kind of application architecture if you design your application as a group of services. The grouping of the services to perform a group of common tasks is what makes an application. In fact many applications can consume those services and perform lots of other functionality with other services.






Re: Architecture General SOA architecture question

V1.0.0.0

Before deciding the level of my answer, let us try to understand a few things, after reading the replies posted so far:

1. Did you understand what does the Architechture of a system mean What kind of Process are you planning to use for architecting your system (this may not directly relate to your question though)

2. Did you understand whether your question is an architectural level question or not

3. Did you understand what effort at the Architectural level needs to be invested in the system that you are designing (again not directly related to your query, but would definately have an impact on defining your Architectural Stratergy)

4. Did you understand that I was not talking about modularizing the business layer in my answer I was talking in a totally different sense and probably you were not on the same page of thinking level that I was on.

5. Can you correlate between the different kinds of processes that you have used till now, for Architecting a system, with your current requirement

There are a lot more many questions that need to be answered before we can define (forget architechting and selecting a strategy) a solution approach for your system.

I would appreciate if you could povide answers to the abovementioned questions, as it would help in coming up with a more concrete solution to your problem.

Thanks.





Re: Architecture General SOA architecture question

kbghost

Thanks everybody for your posts. After reading all the links posted and researching SOA a bit more, I do think am understanding a bit more why this is not SOA. As Udi Dahan posted, I believe the answer is in just having the same DAL in both projects. I'm still a noob in architecture, so I'll try and answer your questions as best as possible Smile

1. Did you understand what does the Architechture of a system mean What kind of Process are you planning to use for architecting your system (this may not directly relate to your question though)


Thinking it over, I think I am just going to use the n-tiered architecture of a website. The process isn't too complicated and as mentioned previously, I don't think the system required SOA. In a nutshell, it's just pulling and manipulating data.


2. Did you understand whether your question is an architectural level question or not


yes... haha, I believed it was an architectural question.


3. Did you understand what effort at the Architectural level needs to be invested in the system that you are designing (again not directly related to your query, but would definately have an impact on defining your Architectural Stratergy)


My mistake, I believe, was in thinking that a library should be consolidated to one area. I wasn't quite sure if it was better design to have only one exisiting library floating around rather then two copies of it. I reasoned that it was bad design to have two cause if there were changes in the DAL, you'd have to update both the application's and website's DAL. But as it seems, it's not as big of an issue as I thought it was. But I am seeing your point in that things need to be fleshed out more before I commit to any architectural style. Since I am still in the early phases of my project, I am still trying to understand the project more thoroughly.


That said, the website and application are mainly used for data retrieval, updates, and manipulation. There really isn't any use of services in this design, so I don't see a need to use it. Seems like a standard n-tiered architecture to me.


4. Did you understand that I was not talking about modularizing the business layer in my answer I was talking in a totally different sense and probably you were not on the same page of thinking level that I was on.


I agree, I think I missed the point. By you saying "modularizing", I mistakenly made the assumption you were modularizing the DAL. This was probably because I don't think the system really needs much further separation of layers since it's mainly just internal data manipulation.


5. Can you correlate between the different kinds of processes that you have used till now, for Architecting a system, with your current requirement


I think this part I still need much more work in. If you'd be willing to expand, I'd be more then happy to listen Smile




Re: Architecture General SOA architecture question

LivetoCodeCodetoLive!

I don't see anything wrong with using and N-tier architecture, but if you share the DAL, changing it twice would be a bother as you mentioned. I think you should look at this link

http://blogs.msdn.com/adonet/archive/2007/04/30/project-codename-astoria-announced-at-mix-07.aspx

It is a new project by the ADO.NET team which will probably interest you.






Re: Architecture General SOA architecture question

Udi Dahan The Software Simplist

Using a library twice doesn't necessarily mean you'll have to change it twice.

As for Astoria, I'm quite a bit skeptical about its architectural value, as I've written about before: Astoria, SDO, and irrelevance [http://udidahan.weblogs.us/2007/05/01/astoria-sdo-and-irrelevance/]