So I just noticed that mysql is using the same kind of comment embedded documentation format that the php docs use. Now I don''t know about anyone else, but while I love rails, I would really like to see a central documentation repository where developers could add comments in the context of particular functions. As examples scroll down to the bottom of the following two pages: http://dev.mysql.com/doc/refman/4.1/en/create-table.html http://us2.php.net/manual/en/function.var-dump.php Now I mentioned this on the rubyonrails channel the other day and was told that we have the wiki - can''t we just use that? While the wiki is good, I don''t see it as a replacement for having a place where developers can comment in the context of a particular function. While rails has been simple to learn, I''ve hit rough ground trying to find examples of the use of particular functions, something I never had as a problem when working with php. I''m not trying to sing the praises of php since they have their own problems, but I think their documentation system is a good thing and worthy of copying. So the natural response might be "yeah, well if you like this doc system so much, go and build one". Well I don''t have the resources to create such a thing at present, which is why I''m mentioning it here, since I''m thinking maybe it''s something the community can help create. The other issue is that mysql and php have professional organisations associated that I believe put in some effort to moderate the comments. I''m not sure what rails relationship is to any full time organisations, but anyway, I was just wondering what people thought ... CHEERS> SAM
I had the same issue while learning rails, so I''m working on an application to help solve it. I announced the first version on this list yesterday. Check it out here.. annotated documentation for the Rails API. http://rails.outertrack.com/rails/index.html For the next version that I am working on now I am putting the entire documentation in a database (and generating the DB directly from rdoc) and so it should be a good amount better since this gives me more flexibility to do what I need (and add features like search etc..) The project is hosted on rubyforge if you want to contribute - http://rannotate.rubyforge.org -- Conor On 10/31/05, Sam Joseph <sam-wUweuJJ0J032eFz/2MeuCQ@public.gmane.org> wrote:> So I just noticed that mysql is using the same kind of comment embedded > documentation format that the php docs use. > > Now I don''t know about anyone else, but while I love rails, I would > really like to see a central documentation repository where developers > could add comments in the context of particular functions. > > As examples scroll down to the bottom of the following two pages: > > http://dev.mysql.com/doc/refman/4.1/en/create-table.html > http://us2.php.net/manual/en/function.var-dump.php > > Now I mentioned this on the rubyonrails channel the other day and was > told that we have the wiki - can''t we just use that? While the wiki is > good, I don''t see it as a replacement for having a place where > developers can comment in the context of a particular function. While > rails has been simple to learn, I''ve hit rough ground trying to find > examples of the use of particular functions, something I never had as a > problem when working with php. I''m not trying to sing the praises of php > since they have their own problems, but I think their documentation > system is a good thing and worthy of copying. > > So the natural response might be "yeah, well if you like this doc system > so much, go and build one". Well I don''t have the resources to create > such a thing at present, which is why I''m mentioning it here, since I''m > thinking maybe it''s something the community can help create. > > The other issue is that mysql and php have professional organisations > associated that I believe put in some effort to moderate the comments. > I''m not sure what rails relationship is to any full time organisations, > but anyway, I was just wondering what people thought ... > > CHEERS> SAM > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Conor Hunt wrote:> I had the same issue while learning rails, so I''m working on an > application to help solve it. I announced the first version on this > list yesterday. Check it out here.. annotated documentation for the > Rails API. > > http://rails.outertrack.com/rails/index.html > > For the next version that I am working on now I am putting the entire > documentation in a database (and generating the DB directly from rdoc) > and so it should be a good amount better since this gives me more > flexibility to do what I need (and add features like search etc..) > > The project is hosted on rubyforge if you want to contribute - > http://rannotate.rubyforge.org >Very cool and great work Conor!! Do you know if 37signals is going to integrate this with their api.rubyonrails.com ? Zach
On Tue, 2005-11-01 at 10:50 +0900, Sam Joseph wrote:> So I just noticed that mysql is using the same kind of comment embedded > documentation format that the php docs use. > > Now I don''t know about anyone else, but while I love rails, I would > really like to see a central documentation repository where developers > could add comments in the context of particular functions. >Ruby Docs have hoodwinks now... so we can comment all we want there now. I''m sure that we could get this added fairly quickly to the Rails documentation if someone volunteered to add the winks to http://hoodwink.d/ . -Robby -- /****************************************************** * Robby Russell, Owner.Developer.Geek * PLANET ARGON, Open Source Solutions & Web Hosting * Portland, Oregon | p: 503.351.4730 | f: 815.642.4068 * www.planetargon.com | www.robbyonrails.com * Programming Rails | www.programmingrails.com *******************************************************/
On Mon, 2005-10-31 at 20:47 -0800, Robby Russell wrote:> On Tue, 2005-11-01 at 10:50 +0900, Sam Joseph wrote: > > So I just noticed that mysql is using the same kind of comment embedded > > documentation format that the php docs use. > > > > Now I don''t know about anyone else, but while I love rails, I would > > really like to see a central documentation repository where developers > > could add comments in the context of particular functions. > > > > Ruby Docs have hoodwinks now... so we can comment all we want there now. > I''m sure that we could get this added fairly quickly to the Rails > documentation if someone volunteered to add the winks to > http://hoodwink.d/ .As cool as hoodwink.d is, it seems unlikely people new to rails will be very ready to learn about the heavily undocumented hoodwink.d or mouseHole proxy. The PHP docs were the best thing about the language, both the ease of search and the good commentary. I''d be for a quickie search tool a little more advanced than Ctrl-F. One could always make something local to their intranet or even publish is to the net, but it''d be nice on the official docs for those who are just arriving. Just my two cents, -Matt B> > -Robby >
I''m very new to Ruby and to Rails. Although I already prefer Rails over PHP, I can say that the PHP documentation is really easy to use and it would be a pleasure to use the same type of documentation for Ruby and for Rails. I even thought the PHP docs were great before comparing them to the Rails docs. NIce to have a familiar environment for those converting to Rails to smooth the transition. Peter On 31-Oct-05, at 5:50 PM, Sam Joseph wrote:> So I just noticed that mysql is using the same kind of comment embedded > documentation format that the php docs use. > > Now I don''t know about anyone else, but while I love rails, I would > really like to see a central documentation repository where developers > could add comments in the context of particular functions. > > As examples scroll down to the bottom of the following two pages: > > http://dev.mysql.com/doc/refman/4.1/en/create-table.html > http://us2.php.net/manual/en/function.var-dump.php > > Now I mentioned this on the rubyonrails channel the other day and was > told that we have the wiki - can''t we just use that? While the wiki is > good, I don''t see it as a replacement for having a place where > developers can comment in the context of a particular function. While > rails has been simple to learn, I''ve hit rough ground trying to find > examples of the use of particular functions, something I never had as a > problem when working with php. I''m not trying to sing the praises of > php > since they have their own problems, but I think their documentation > system is a good thing and worthy of copying. > > So the natural response might be "yeah, well if you like this doc > system > so much, go and build one". Well I don''t have the resources to create > such a thing at present, which is why I''m mentioning it here, since I''m > thinking maybe it''s something the community can help create. > > The other issue is that mysql and php have professional organisations > associated that I believe put in some effort to moderate the comments. > I''m not sure what rails relationship is to any full time organisations, > but anyway, I was just wondering what people thought ... > > CHEERS> SAM
On 1.11.2005, at 4.25, Conor Hunt wrote:> I had the same issue while learning rails, so I''m working on an > application to help solve it. I announced the first version on this > list yesterday. Check it out here.. annotated documentation for the > Rails API. > > http://rails.outertrack.com/rails/index.html > > For the next version that I am working on now I am putting the entire > documentation in a database (and generating the DB directly from rdoc) > and so it should be a good amount better since this gives me more > flexibility to do what I need (and add features like search etc..)RailDock (http://raildock.mytechsupport.com/) has been around for a while already and does both annotating and search (with live suggestions). For some reason the last comment added is from August. //jarkko> > The project is hosted on rubyforge if you want to contribute - > http://rannotate.rubyforge.org > > -- > Conor > > On 10/31/05, Sam Joseph <sam-wUweuJJ0J032eFz/2MeuCQ@public.gmane.org> wrote: > >> So I just noticed that mysql is using the same kind of comment >> embedded >> documentation format that the php docs use. >> >> Now I don''t know about anyone else, but while I love rails, I would >> really like to see a central documentation repository where >> developers >> could add comments in the context of particular functions. >> >> As examples scroll down to the bottom of the following two pages: >> >> http://dev.mysql.com/doc/refman/4.1/en/create-table.html >> http://us2.php.net/manual/en/function.var-dump.php >> >> Now I mentioned this on the rubyonrails channel the other day and was >> told that we have the wiki - can''t we just use that? While the >> wiki is >> good, I don''t see it as a replacement for having a place where >> developers can comment in the context of a particular function. While >> rails has been simple to learn, I''ve hit rough ground trying to find >> examples of the use of particular functions, something I never had >> as a >> problem when working with php. I''m not trying to sing the praises >> of php >> since they have their own problems, but I think their documentation >> system is a good thing and worthy of copying. >> >> So the natural response might be "yeah, well if you like this doc >> system >> so much, go and build one". Well I don''t have the resources to create >> such a thing at present, which is why I''m mentioning it here, >> since I''m >> thinking maybe it''s something the community can help create. >> >> The other issue is that mysql and php have professional organisations >> associated that I believe put in some effort to moderate the >> comments. >> I''m not sure what rails relationship is to any full time >> organisations, >> but anyway, I was just wondering what people thought ... >> >> CHEERS> SAM >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >-- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
We are just writing an article about open-source documentation for a soon to be published book about micro-learning. The title is "RTFM and teach yourself!". RTFM stands for "Read the fucking manual". We´ve been reviewing about 50 different frameworks/CMS. One of the common problems seems to be that so-called micro-content is published in containers (Manuals, Tutorials, FAQs, Mailingslists ...) which are not connected and coordinated (e.g. you are not able to search through all of them at once). Moreover, it´s usually not possible to evaluate and expand these knowledge-nuggets by using additional metadata. Another problem seems to be DESIGN. Most open-source projects don´t seem to get the necessity of having a designer doing their website. Some research outcomes concerning RoR: --- micro-content is not connected --- no possibility to add metadata for micro-content --- information design is not continuous --- terms are noncoherent (e.g. community = wiki?) +++ the wiki (http://wiki.rubyonrails.com) is a good example of cooperative strcutures (although, there is no metadata for different paths through the content, e.g. "newbie", "advanced" etc.) +++ mailinglist is searchable +++ documentation is an issue (very important and probably a good starting-point) +++ tutorial-videos Personal opinion: +++ It´s easy to do the first steps (thanks to Locomotive at this point) --- but then again, it´s hard to move forward --- the RoR-Website is too complex - it´s really hard to find things Sorry for maybe being too critical here - i do like RoR very much and just wanted to share our provisional research outcome. Patrick Kranzlmüller Mag. phil. Patrick Kranzlmüller vonautomatisch werkstaetten Kettenbrueckengasse 13/10. 1050 wien E-Mail: patrick-KzucmO8QuWNZ0wkgCNX5VF6hYfS7NtTn@public.gmane.org WWW: www.vonautomatisch.at> I''m very new to Ruby and to Rails. Although I already prefer Rails over > PHP, I can say that the PHP documentation is really easy to use and it > would be a pleasure to use the same type of documentation for Ruby and > for Rails. I even thought the PHP docs were great before comparing them > to the Rails docs. NIce to have a familiar environment for those > converting to Rails to smooth the transition. > > Peter > > > > > On 31-Oct-05, at 5:50 PM, Sam Joseph wrote: > >> So I just noticed that mysql is using the same kind of comment embedded >> documentation format that the php docs use. >> >> Now I don''t know about anyone else, but while I love rails, I would >> really like to see a central documentation repository where developers >> could add comments in the context of particular functions. >> >> As examples scroll down to the bottom of the following two pages: >> >> http://dev.mysql.com/doc/refman/4.1/en/create-table.html >> http://us2.php.net/manual/en/function.var-dump.php >> >> Now I mentioned this on the rubyonrails channel the other day and was >> told that we have the wiki - can''t we just use that? While the wiki is >> good, I don''t see it as a replacement for having a place where >> developers can comment in the context of a particular function. While >> rails has been simple to learn, I''ve hit rough ground trying to find >> examples of the use of particular functions, something I never had as a >> problem when working with php. I''m not trying to sing the praises of >> php >> since they have their own problems, but I think their documentation >> system is a good thing and worthy of copying. >> >> So the natural response might be "yeah, well if you like this doc >> system >> so much, go and build one". Well I don''t have the resources to create >> such a thing at present, which is why I''m mentioning it here, since I''m >> thinking maybe it''s something the community can help create. >> >> The other issue is that mysql and php have professional organisations >> associated that I believe put in some effort to moderate the comments. >> I''m not sure what rails relationship is to any full time organisations, >> but anyway, I was just wondering what people thought ... >> >> CHEERS> SAM > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On 11/1/05, Jarkko Laine <jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote:> > For the next version that I am working on now I am putting the entire > > documentation in a database (and generating the DB directly from rdoc) > > and so it should be a good amount better since this gives me more > > flexibility to do what I need (and add features like search etc..) > > RailDock (http://raildock.mytechsupport.com/) has been around for a > while already and does both annotating and search (with live > suggestions). For some reason the last comment added is from August.RailDock is very nice, but it is a bit slow and unintuitive. Maybe if it had menus like on api.rubyonrails.com, for "discoverability", as opposed to a search box. But still, it doesn''t beat having the comments on the ''official'' documentation website. -- Michel Valdrighi Devéloppeur Web Intraordinaire http://zengun.org/weblog/
I hadn''t seen that when I was searching for similar tools. Raildoc looks good, but it really needs to be browsable to be a useful documentation source. I think the approach that I am talking of creating a DB generator for rdoc will result in much more flexible documentation output and searching. -- Conor On 11/1/05, Jarkko Laine <jarkko-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote:> > On 1.11.2005, at 4.25, Conor Hunt wrote: > > > I had the same issue while learning rails, so I''m working on an > > application to help solve it. I announced the first version on this > > list yesterday. Check it out here.. annotated documentation for the > > Rails API. > > > > http://rails.outertrack.com/rails/index.html > > > > For the next version that I am working on now I am putting the entire > > documentation in a database (and generating the DB directly from rdoc) > > and so it should be a good amount better since this gives me more > > flexibility to do what I need (and add features like search etc..) > > RailDock (http://raildock.mytechsupport.com/) has been around for a > while already and does both annotating and search (with live > suggestions). For some reason the last comment added is from August. > > //jarkko > > > > > > The project is hosted on rubyforge if you want to contribute - > > http://rannotate.rubyforge.org > > > > -- > > Conor > > > > On 10/31/05, Sam Joseph <sam-wUweuJJ0J032eFz/2MeuCQ@public.gmane.org> wrote: > > > >> So I just noticed that mysql is using the same kind of comment > >> embedded > >> documentation format that the php docs use. > >> > >> Now I don''t know about anyone else, but while I love rails, I would > >> really like to see a central documentation repository where > >> developers > >> could add comments in the context of particular functions. > >> > >> As examples scroll down to the bottom of the following two pages: > >> > >> http://dev.mysql.com/doc/refman/4.1/en/create-table.html > >> http://us2.php.net/manual/en/function.var-dump.php > >> > >> Now I mentioned this on the rubyonrails channel the other day and was > >> told that we have the wiki - can''t we just use that? While the > >> wiki is > >> good, I don''t see it as a replacement for having a place where > >> developers can comment in the context of a particular function. While > >> rails has been simple to learn, I''ve hit rough ground trying to find > >> examples of the use of particular functions, something I never had > >> as a > >> problem when working with php. I''m not trying to sing the praises > >> of php > >> since they have their own problems, but I think their documentation > >> system is a good thing and worthy of copying. > >> > >> So the natural response might be "yeah, well if you like this doc > >> system > >> so much, go and build one". Well I don''t have the resources to create > >> such a thing at present, which is why I''m mentioning it here, > >> since I''m > >> thinking maybe it''s something the community can help create. > >> > >> The other issue is that mysql and php have professional organisations > >> associated that I believe put in some effort to moderate the > >> comments. > >> I''m not sure what rails relationship is to any full time > >> organisations, > >> but anyway, I was just wondering what people thought ... > >> > >> CHEERS> SAM > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > >> > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > -- > Jarkko Laine > http://jlaine.net > http://odesign.fi > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > >
Thanks for all the feedback on my rails documentation question. Apologies to Conor for not picking up on the release of rannotate, which is exactly the kind of thing I was looking for - great work Conor. However I was also interested to hear from Jarkko about the presence and lack of recent activity of RailDock. I think Zach''s question is the critical one. Will 37signals take up using this framework to integrate it with api.rubyonrails.com? As the raildock example perhaps shows, an important factor in the success of these community annotation systems is that there is one of them that the maintainers are backing, e.g. php.net/docs.php and dev.mysql.com/doc/ - the point being that newcomers will find a central repository. I could have been using RailDock for the last two months but never heard of it, or found it in my searches. I guess I start to wonder who on this list is at 37signals and what kind of resources 37signals is devoting to rubyonrails. I don''t mean to be paranoid, just it would be nice to know who things like this should be proposed to, and what chance they might have of being taken up. CHEERS> SAM
On 11/1/05, Conor Hunt <conor.hunt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I hadn''t seen that when I was searching for similar tools. Raildoc > looks good, but it really needs to be browsable to be a useful > documentation source. I think the approach that I am talking of > creating a DB generator for rdoc will result in much more flexible > documentation output and searching.Something else that might be helpful would be the ability to see diffs between different versions of an rdoc page. With the ever evolving Rails, sometimes I don''t notice a new feature when it is first documented. --> Dennis Sutch > dennis-+mObuC4wx48AvxtiuMwx3w@public.gmane.org_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
> Something else that might be helpful would be the ability to see diffs > between different versions of an rdoc page. With the ever evolving Rails, > sometimes I don''t notice a new feature when it is first documented.The changelogs document the changes for each part of the framework. -- rick http://techno-weenie.net
I''d like to see a DB generator for RDoc too, but don''t have time these days to do it :( On Tue, 2005-11-01 at 10:21 -0500, Conor Hunt wrote:> I hadn''t seen that when I was searching for similar tools. Raildoc > looks good, but it really needs to be browsable to be a useful > documentation source. I think the approach that I am talking of > creating a DB generator for rdoc will result in much more flexible > documentation output and searching.
It''s done :) I''m finished with it. It outputs to a file a bunch of sql INSERT statements. I considered YAML or serializing the code_object.rb, but this was easiest for me. If you''d like to have a look I have checked it into my rannotate project on rubyforge in the rannotate\rdoc_extension directory. It is called db_generator.rb. The table strucutre is contained in rannotate.sql in the \db directory. I''m now working on outputting that DB info into documentation (a controller and bunch of rhtml files). I think after this weekend you''ll see a first version. -- Conor On 11/2/05, Jerrett Taylor <jerrett-7g3wz9A/6AxWk0Htik3J/w@public.gmane.org> wrote:> I''d like to see a DB generator for RDoc too, but don''t have time these > days to do it :( > > > > > On Tue, 2005-11-01 at 10:21 -0500, Conor Hunt wrote: > > I hadn''t seen that when I was searching for similar tools. Raildoc > > looks good, but it really needs to be browsable to be a useful > > documentation source. I think the approach that I am talking of > > creating a DB generator for rdoc will result in much more flexible > > documentation output and searching. > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hi everyone, It is not a Rails specific question, rather a DB question: I am building a Hotel Reservation System using RoR and have faced the following problem: My models: Country has many Cities City has many Hotels Hotel has many Rooms. Room has many Prices Price ( id, date, net_rate, allocations) We plan to have about 5000 hotels registered, each hotel will have about 4 Rooms That gives us 2000 Rooms. Each Room will have about 3 (Years ahead) x 365 (Days) Prices That will give about 2-3 million or even 6 million rows in prices table. We want to be able to execute fast search queries in the prices table (less than 1 second) Here''s my question: Is PostgreSQL or MySQL capable of performing <1000 ms query on such a table (properly indexed) ? Or do we need some other, more "condensed" schema ? I have figured out that we will be querying prices only per City/Country, there won''t be any queries across cities/countries so we could divide our prices table into country specific, for example prices_1 (table holding country_id=1 prices) prices_2 (table holding country_id=2 price etc.) That would divide those million rows by 50, 60 (50 thousand rows tables) or so and would surely speed up queries, but would require creating a new prices_ table for each country (we have 100 countries -> that gives us 100 price tables) Is there a standard way to solve this kind of problem, am I missing something obvious ? Any hints would be greatly appreciated. -- Best Karol Hosiawa
> It is not a Rails specific question, rather a DB question: > I am building a Hotel Reservation System using RoR and have > faced the following problem: > > My models: > > Country has many Cities > City has many Hotels > Hotel has many Rooms. > Room has many Prices > > Price ( id, date, net_rate, allocations) > > We plan to have about 5000 hotels registered, each hotel will > have about > 4 Rooms > That gives us 2000 Rooms.Math is off by a zero here, so it would be 20,000 rooms (5,000 hotels X 4 Rooms each).> Each Room will have about 3 (Years ahead) x 365 (Days) Prices > That will give about 2-3 million or even 6 million rows in > prices table.Based on the extra zero, that is actually 21.9 million records. Definitely too many for a table. What I would suggest is having only the days in which each room changes its prices stored in the database. So if from, January 24 - March 31 the cost per room a night is $93, and it jumps to $123 a night on April 1st, only store those two records separately. So store price(:date => ''01-24-2006'', :price => ''93.00''), and put in a record for the newly adjusted price on the next date which may be something like this price(:date => ''04-01-2006'', :price => ''123.00''). I would recommend putting the logic into a PgSQL function, and have some checking done to enter in start and end date, and it return the price for that duration. Would be some simple PL/PGSQL logic. Another way could be to have the logic done in your model, which may be a bit slower, but you could have the hotel room model load in all the prices for each of the days it changes. That being said, it would likely drop the number of records down immensely. I can really only see the price of a hotel room changing 4 times a year, so that totals 12 rows per room, times 20,000 rooms. That puts it at around 240,000 records for all the rooms across the 5,000 hotels with 4 rooms a piece. PgSQL should have no problem handling that if its optimized well. MySQL, it is likely it could be done, but would require quite a bit of optimization as well. I am moving more and more towards PgSQL in my development environment as it has some great advanced functionality, which some say isn''t the Rails way, but I tend to disagree a tad on that ;) Warmest regards, Nathan. -------------------------------------------------------------- Nathaniel S. H. Brown Toll Free 1.877.4.INIMIT Inimit Innovations Phone 604.724.6624 www.inimit.com Fax 604.444.9942
Try to have as much of the where part of your query in indexes if you can do this, I think the result should be really fast. You can always do a speed test yourself to find out how fast this will be by programmaticly inserting mock data. Then toy around with indexes / splitting up the data. Oh and after all that it all depends on the strain of your DB server, the hardware in the DB server etc. And the fact if it is a: Shared host / dedicated host / dedicated DB ----- Original Message ----- From: "Karol Hosiawa" <hosiawak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> Sent: Friday, November 04, 2005 10:32 AM Subject: [Rails] Best DB Schema Help> Hi everyone, > > It is not a Rails specific question, rather a DB question: > I am building a Hotel Reservation System using RoR and have faced the > following problem: > > My models: > > Country has many Cities > City has many Hotels > Hotel has many Rooms. > Room has many Prices > > Price ( id, date, net_rate, allocations) > > We plan to have about 5000 hotels registered, each hotel will have about 4 > Rooms > That gives us 2000 Rooms. > Each Room will have about 3 (Years ahead) x 365 (Days) Prices > That will give about 2-3 million or even 6 million rows in prices table. > We want to be able to execute fast search queries in the prices table > (less than 1 second) > Here''s my question: > > Is PostgreSQL or MySQL capable of performing <1000 ms query on such a > table (properly indexed) ? > Or do we need some other, more "condensed" schema ? > > I have figured out that we will be querying prices only per City/Country, > there won''t be any queries across > cities/countries so we could divide our prices table into country > specific, for example > prices_1 (table holding country_id=1 prices) > prices_2 (table holding country_id=2 price etc.) > > That would divide those million rows by 50, 60 (50 thousand rows tables) > or so and would surely speed up queries, but would > require creating a new prices_ table for each country (we have 100 > countries -> that gives us 100 price tables) > > Is there a standard way to solve this kind of problem, am I missing > something obvious ? > > Any hints would be greatly appreciated. > > -- > Best > Karol Hosiawa > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On 11/4/05, Nathaniel S. H. Brown <nshb-wgYSSEAWXinQT0dZR+AlfA@public.gmane.org> wrote:> > > What I would suggest is having only the days in which each room changes > its > prices stored in the database. > > So if from, January 24 - March 31 the cost per room a night is $93, and it > jumps to $123 a night on April 1st, only store those two records > separately. > So store price(:date => ''01-24-2006'', :price => ''93.00''), and put in a > record for the newly adjusted price on the next date which may be > something > like this price(:date => ''04-01-2006'', :price => ''123.00''). >You are right, I can do that, but I still need to keep record for individual allocations (number of instant rooms available for each day). We have to be able to query the DB: find all rooms that have instant confirmation from 10-10-2005 to 20-10-2005 for example. I will have to figure out a way to store them too, perhaps "compress" them as well. Thanks for your opinion. -- Best Karol Hosiawa _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I''m not really sure this will be applying to you, but there are offcourse hotels with different rates for weekends / weekdays. And summer pricing for touristic places which will change prices each week during holidat season. ----- Original Message ----- From: Karol Hosiawa To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Sent: Friday, November 04, 2005 12:19 PM Subject: Re: [Rails] Best DB Schema Help On 11/4/05, Nathaniel S. H. Brown <nshb-wgYSSEAWXinQT0dZR+AlfA@public.gmane.org> wrote: What I would suggest is having only the days in which each room changes its prices stored in the database. So if from, January 24 - March 31 the cost per room a night is $93, and it jumps to $123 a night on April 1st, only store those two records separately. So store price(:date => ''01-24-2006'', :price => ''93.00''), and put in a record for the newly adjusted price on the next date which may be something like this price(:date => ''04-01-2006'', :price => ''123.00 ''). You are right, I can do that, but I still need to keep record for individual allocations (number of instant rooms available for each day). We have to be able to query the DB: find all rooms that have instant confirmation from 10-10-2005 to 20-10-2005 for example. I will have to figure out a way to store them too, perhaps "compress" them as well. Thanks for your opinion. -- Best Karol Hosiawa ------------------------------------------------------------------------------ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
patrick k wrote:> We are just writing an article about open-source documentation for a soon to > be published book about micro-learning. > The title is "RTFM and teach yourself!". RTFM stands for "Read the fucking > manual".Just by the title, I think I will need to purchase that book. =) Please post to list or email me privately when it comes out... Zach
it´s actually the title of our article, which will probably be available online once it´s finished. i´ll keep you informed.> patrick k wrote: >> We are just writing an article about open-source documentation for a soon to >> be published book about micro-learning. >> The title is "RTFM and teach yourself!". RTFM stands for "Read the fucking >> manual". > > Just by the title, I think I will need to purchase that book. =) Please > post to list or email me privately when it comes out... > > Zach > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
It''s always the business model to the rescue. Regardless of what I say you are going to have to read a book on hotel management, there are lots of these. Non-techie hotel managers are not going to know what to automate and what to leave out. There can be things the hotel managers think are impossible to computerize that you can do easily, but there are some things they are going to want you to do that are impossible. That''s the nature of business data processing. The hotel managers are simply not going to key in millions of room rates three years in advance anyway. Each room is going to have some pricing attributes: price-class A, B, C et cetera. So all rooms in class C, say, get the same rate. The hotel as a whole is going to change rates on a certain date. Not each room individually. You might have price-class B raise rates for Christmas but have price class C (for truckers) stay the same, who knows. That''s a business model decision. Each price class will have a nominal rate and a set of dates for increasing and decreasing rates. Hotels in the North are going to charge more in the summer and hotels in the south are going to charge more in the winter. Each hotel manager needs to set up that hotel for itself. When New Orleans gets going again, hotels there will charge more for Mardi Gras and Hotels in Florida will charge more for spring break. Et cetera. No need to keep prices on a per room basis individually. No hotel needs to have 100 different prices for 100 different rooms. After midnight or 9 PM, empty rooms go for less (or for more!) -- they negotiate with late comers. So each front desk needs a certain leeway to enter the negotiated price. So each price class needs to have a nominal price and a minimal negotiated price. The hotel manager needs to be able to negotiate special low rates every now and again for straggling families in emergencies, to override the minimum the front desk clerk cannot do. They probably skip the mint on the pillow and the extra room cleaning for those folks. And when the super-bowl comes to town each hotel manager needs to be able to raise rates a year in advance for all the price classes in the hotel. Then you''ve got smoking and non-smoking rooms and you''ve got some people who must be on a high floor and some who must be on the first floor. Who knows, maybe price varies per floor as well as per which side of the building they''re on (the view). You''ll need to store the price actually charged and the financial information of the payer. Security is going to be extremely important as hackers will want to know which politicians slept where and when and they''re going to want to get at your financial information. There exists numerous existing software systems for hotel management and reservations and you should read their advertising and their feature lists. If you''ll be reserving rooms in advance on your computer system then you''ll need to distinguish between guaranteed rooms and reserved rooms. And so on and so on. Warren Seltzer