The BibleServer website with new “DB guts”

It took me 2 days to rework BibleServer so that it uses only the SQL Server database when displaying data from the Bible. During those 2 days I was not only rewriting code, but of course also writing completely new code (for example, to build improved SQL Server tables from the Bible file) and exploring options (for example, how long the verses are).

Now it has paid off and the website already works. The speed of the application has not suffered; it may even have become faster. Before this change I used a combination and loaded data from 3 sources: files on disk (which take up 2.53MB on my disk at least, with an actual size of 5.91MB), some things from the DB, and above all from RAM, where I loaded the entire Bible at web application startup.

Precisely because I now store nothing in RAM, my memory usage dropped by a staggering 100MB, which is half of my space in RAM for my application, since I have a 200MB limit, and exceeding it resets my application.

Search speeds

The slowest is full-text search. Times there are around 0.07s on my machine and 0.15s on the hosting, so on the hosting it is up to 2.5x slower. Compare the same search with the same parameters on my machine and on the hosting:



Full-text search on localhost is faster



Search on the website is just slightly slower

When searching by passage, the speed is not measured, but with the last search type – by verses – it is. When entering 1 chapter of a Biblical book with 3 verses, the speed is as follows – less than 0.01s locally and 0.01s on the website. Of course, as the number of verses grows, this time will increase:



Finding 3 verses is ultra fast locally 🙂



But the same thing on the website is not that slow either 🙂

Space used in the DB

Of course, if I delete something somewhere (RAM) and want it to keep working, I have to put it somewhere else. And as you already know, it is now in the DB. I did not expect it to take up so much space, but compared to the RAM it used before, it is not that bad.



This is how it looked in my DB before deleting the old and setting up the new tables



And this is how it looks now 🙂

Finally, I will just add that I would like to do this conversion to a pure DB solution for more websites :). In addition, the BibleServer website now has everything I write about here, as well as “Statistics for enthusiasts” – these are objective and based on real data, except for the minimum, average and maximum length, where I must have made a mistake in the calculations. If you want to take a look, do it right away, because I will delete those statistics soon (I would say within 2 days at most).

Categories

Leave a Reply