开发者

How to create New Database for job portal based on Industry?

I have planned to create the job portal based on Industry like IT ,Pharma,banking,Airlines,Sales.

Option 1:

I have decided to create the seperate DB for each Industry but maintain the user account details in common DB

For example , Main DB is jobportal contains all useraccount details and common tables like country ,state ,city,designation in common Db

other 5 DB are IT ,Pharma,banking,Airlines,Sales .

Connect Main DB with all other DB..

option 2 :

Maintain all tables in Single DB only.But problem is job posting details different from industry to industry .so we cannot maintain common table for all industries..not only jobposting ..some other tables all same type of problem ..

option 3 :

Maintain Completly seperate DB for 开发者_StackOverflow中文版each Industries.. No relation between all DB..

Which one Best? Or any other option to do that other than these three ? Please guide me regarding this..


From "The Pragmatic Programmer" : "Put abstractions in code, details in metadata."

This is what I propose. You should program using metadata (the more you do it, the most general and portable is your code).

So one/multiple table for users A table for industries A table for fields -> industries A table for posting

You would get something like this

|-------| ?? |----------| 1--->* |-----------------| 1--->* |------------------|
| users |    | industry |        | industry_fields |        | industry_posting |
|-------|    |----------|        |-----------------|        |------------------|
| name  |    | name     |        | field_name      |        | field_id         |
| pass  |    | id?      |        | industry_id     |        | description      |
| ...   |    |----------|        | id              |        |------------------|
|-------|                        |-----------------|

this is a quick draft , hoping you understand the basics of it. You can, like that maintain common tables for industries. you could also map one field to multiple industries with a many-to-many! This is only an excerpt


Another solution, when you have a base entity to persist - in this case, "job posting" - with different specific fields per industry, is an inheritance model.

See this question, and the links within, for a primer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜