There are a number of reasons why Google Analytics may not be showing the traffic your database shows...
Your Code Is Positioned Poorly
Your GA tracking code should be in the head section of the document, some webmasters put it in the bottom to improve load times however this can sometimes mean that the user has come to your site and then bounced right back out before GA has finished loading.
(https://support.google.com/analytics/answer/1008080)
User Has Javascript Disabled
GA depends on javascript to run. Some users have javascript switched off in their browsers for security reasons. Most web crawlers don't process javascript either and so a crawler won't show up in GA while your server logs and database log will show the traffic from the crawler.
User Has Opted Out of Analytics
Google provides a browser add-on to opt out of Google Analytics. When this add-on is detected GA will not log any details about the browser and as far as your GA report the user never connected.
(https://support.google.com/analytics/answer/181881?hl=en)
High Volume
In some instances where GA data is consistently off base with your own analytics it can indicate that Google has decided to start sampling your data instead of showing all of your data. This is generally due to a high amount of traffic but I have been unable to find any details on the Google support page (https://support.google.com/analytics/answer/2637192?hl=en) about what sort of traffic limits there are before sampling comes into place. The only way to avoid this is to use another analytics provider as it is forced into GA free to limit excessive loads on the GA network.
As you can see there are a number of reasons why Google Analytics will not show all the records your database or server analytics do and these aren't all the reasons, just the most common. You will probably find that the large discrepancy is to do with multiple issues some of which will be in this list. As a side note the only one of these issues that can be fixed is the code position, the other issues can't be fixed.