Wednesday, January 02, 2008

architecture and distributed caching thoughts in combination with indeXus.Net SharedCache - Part 2

SharedCache thought no. 2: How do I gone access my data?


there are almost endless way's how to retrieve data from your RDBMS* system.


Here a small list of options:

  • ORM (Object Relational Mappers) [my favorite: MyGeneration thanks to Mike Griffin for this amazing tool]
  • ODBC / JDBC (or other direct API's)
  • own implementation [ your are gone to work very hard :-) ]


in almost every application there is a "best way" to access your data. A large-scale set oriented application will usually be ODBC / JDBC oriented. While a mix of set- and identiyoriented approaches are indications for ORM's. Its very important to understand and to know your application to make the decision, most applications have a best way depends on their scalability requirements and development time.


Consider: Databases don't hate anything more then to retrieve data of one single row! To choose the wrong approach is disastrous!!


Lets try to say it in this way: RDBMS (ODBC / JDBC) systems are optimized for set based queries and operations including joins and data aggregation. They will crumble with heavy row-level access applications (1+N access patterns).
Its always a good approach to discuss an architecture open, then you have to consider many things and you should be careful while you're taking your decision about it. Not always the obvious way is the "best choice".


Most applications have a mix of intensive row-level and large set-level operations, which lend themselves poorly to any noted approach. I haven't seen till today any architecture which the issue doesn't come up: "exceptions to the rule"! Even if you have a well-architecture and carefully designed application there can be always exceptions that require to break the rule for a specific approach how to access data.


Normally, or at least in 90% of the cases I have seen till today, its possible to cache ODBC result sets. I have also seen ORM systems which are able to make SQL query set-based optimization that performs the entire operation within the RDBMS. You should always consider how your application is consuming data.

------------------

Download your copy of SharedCache: http://www.sharedcache.com

SharedCache will soon release session provider, which will assist you to work with SharedCache and ASP.Net Sessions.

Soon i will add some additional thought about how to provide optimistic transactional handling with SharedCache.


SharedCache is free and open source the only way you can see exactly what happens within your application.


* - RDBMS - relational database management system

** - DAO - Data Access Objects

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge