views:

393

answers:

1

Going to develop a search engine.

I'm wondering how my DDD should look. Sorting records should be implemented, but i don't want that my views knew about my database structure (by which columns to sort). As far as i understand - sorting information should come from infrastructure layer, from repository implementation, so there have to be a flexible domain.

How it should look?

I want this to be strongly typed.

Any best practices?

Recommendations for architecture?

+1  A: 

If you are going to develop a search engine, you'll be forced to think about scalability very fast. Sorting in search related environments is a familiar problem. You should have a look at the search implementations from Google! How you sort should depend on a ranking algorithm. A domain centric ranking algorithm design shouldn't be such different from the ranking as a service approach!

What language you use is your choise. If you'll choose C/C++ Message Passing Interface (MPI) for distributed computing. If you use Java, have a look at JMS and GridGain (GridGain implements Googles MapReduce).

Another question is, how to store your data (distributed, fast, fault-tolerant)! For Java have a look at Project Voldemord (which is one of the best systems you can get for free.

For more information about the Google architecture, read more on the high scalability website.

For issues about DDD, have a look at domaindrivendesign.org, the Homepage of Eric Evans himself ;) He has written a very good Book Domain-Driven Design. DDD is fine, because it assures the integrity and the of a Domain.

A simple model might be:

page ( URL url, BigInt rank, List<String> keywords, 
       List<URL> links, List<URL> outLinks, Content ref) 


content ( GzippedBytes[] content )

If a new node is added to the system, it should react on things like "setLinks" etc. so it can get it's pagerank by it's own.

The client ist quient simple, he does only a search ( keywords ) which gets sorted by PageRank.

Here is an service example of a pagerank implementation in Java.

Martin K.
With search engine i did not mean web crawler/indexer. It`s supposed to be ordinary search mechanism over specified business objects.
Arnis L.
Current search method has this signature:Get(string searchColumn, string query, string orderExpr, int startIndex, int maxRows, bool useRanks, int authorRank, int titleRank, int otherRank).
Arnis L.
I don`t know how to ensure, that UI layer knows nothing about database structure yet can sort result page. :)
Arnis L.