Skip to content

groupserver/gs.database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gs.database

Get a database connection for the current GroupServer instance

Authors

Richard Waid; Michael JasonSmith

Contact

Michael JasonSmith <mpj17@onlinegroups.net>

Date

2014-05-21

Organization

GroupServer.org

Copyright

This document is licensed under a Creative Commons Attribution-Share Alike 4.0 International License by OnlineGroups.net.

Introduction

GroupServer stores most of its data using the PostgreSQL relational database1. The SQLAlchemy system is used to provide the connection between GroupServer and PostgreSQL 2. The gs.database product provides some utilities to establish the connection, and use the connection more easily. Most code will perform a query in the same way, and not have to consider which database instance is being used.

See the Sphinx documentation in docs for more information.

Database Instance

Note

For GroupServer installations with only one site there can only be one database instance, so this section can be ignored.

GroupServer is highly scalable:

  • One Zope instance can manage multiple GroupServer instances,
  • One GroupServer instance can manage multiple sites, and
  • One site can handle multiple groups.

The PostgreSQL database is independent of this. A single database instance can be shared by multiple sites. The main advantage of this is that the profile information is shared 3. However, the databases do not need to be shared.

The front-end HTTP proxy is used to set the correct database instance, in much the same way that the proxy is used to select the correct skin4. The proxy should set the HTTP_INSTANCEID environment variable in the HTTP request to the ID of the database to connect to. The gs.database.core.getInstanceId utility, which is called by both getTable and getSession, will then examine this environment variable to determine the correct database instance for the current request.

Resources


  1. Neither files, nor image caches are stored in the relational database. These are the the two major exceptions to the "data is in the database" rule.

  2. The zope.sqlalchemy product also provides some integration between Zope transactions and the SQLAlchemy transactions.

  3. By sharing profile information between sites people can use the same profile to log in to multiple sites, and do not have to verify their email address for each site.

  4. Skins are not just colour-schemes, but entire collections of code. As crazy as it sounds, selecting a skin based on URL can change vast amounts of behaviour, and is normal with Zope.

About

Database connection utilities for GroupServer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages