As we are using Cassandra in our development process, we are encountering problems with it. Contrary to an SQL database, Cassandra is very light weight and can at times fail to the point where you cannot use a node anymore.

When that happens on a development system, we can simply delete everything and restart fresh. Fine.

However, in a production system, you're going to run into some problems if you lose a node and... that's the only node you have. In that case, you'd need a backup. However, the idea of Cassandra is to run many nodes to have automatic backups. If one node causes ...

As I am working on the system, I often saw this error saying that the server could not connect.

I now know exactly why it happens, and have a very simple solution.

When I setup the Snap! C++ server to connect to the Cassandra server, I used "localhost" as the address. Since we only want to connect to Cassandra locally while doing development (once installed, not so much!)

The result of using localhost is that the address lookup returns two addresses:

IPv6 or [::1]
IPv4 or 127.0.0.1

Then the Thrift library decides to first test the IPv6 address (which makes sens, they are ...

Any file uploaded to the website is considered to be an attachment.

An attachment represents a file such as a JavaScript, a CSS, an Image, a third party PDF file, etc.

The content plugin handles the creation and update of attachments because it is the same as regular content as far as content on the site is concerned. The attachment files appear in the files table under their corresponding MD5 sum. The MD5 sum is used to avoid duplication, not as a security feature. So if many users all upload the exact same image, the database includes the image exactly once (of course, Cassandra generates ...

The process can be hard to follow because many signals get called.

The following is an attempt in helping you (developers) find your way better in the Snap! environment.

  1. snap.cgi gets called by Apache
  2. snap.cgi connects to snapserver
  3. snap.cgi sends the Apache parameters to snapserver
  4. snapserver creates a snap_child object
  5. snap_child verifies the data sent by snap.cgi
  6. snap_child loads the plugins
  7. snap_child calls the execute() signal
  8. path plugin responds by checking that the path is valid:
    1. Page is in Cassandra: get the ...

As I'm working on Snap! C++, I have many places were I want to record a list of something.

Many times that list includes a reference to another column. Within the content table I use the links plugin to create references / connections.

So... Today I was enhancing the use of attachments to posts you make on a website. The actual files get saved in a table named files and I wanted to know who saved that file so I have a reference back to the content page. This will be useful when I want to file all the pages because, for example, the file is proven to be a virus.

If you're an SQL ...

To accelerate the transfers between clients and servers even further we want to at some point look into supporting SPDY.

SPDY was developed by Google with HTTPS and compression in mind. Also it allows streaming of all the data on a single channel instead of a multi-connection scheme most often seen these days. There is an Apache2 module for this features. We'd have to make sure that it is compatible with Snap! C++.

Source: https://en.wikipedia.org/wiki/SPDY

What is the Session Random Number?

Each time a user access Snap! Websites pages, he receives a cookie. That cookie include a session identifier and a session random number defined as:

<session identifier>/<session random number>

The session identifier does not change between accesses unless something goes wrong. The session random number changes on each access. This allows us to prevent the use of a session by a hacker for more than one page access if both the hacker and the user being hacked both use the site at the same time. Figure 1 shows a normal session with a ...

Introduction (implemented)

Snap! Websites make use of sessions to track the user and react accordingly.

There are currently three types of sessions:

  • Form Sessions
  • User Sessions
  • Secure Sessions

The following describes their use. Note that the basic type of a session does not automatically mean it is used by a plugin of that name. It is viewed as a security level for the session rather than the owner of the session.

Form Sessions

To avoid a lot of website spam, forms have to be protected. This is done by creating a session for the form. The form is then given a ...

I cannot comment?!

Actually, you can comment on newer blog posts when they occur (i.e. infrequently!)

But we otherwise turned off the comment feature because 99.9% is not constructive (yes, spam.) So there is no point for us to support such. Plus SourceForge.net has a better feature with their tickets which (1) rarely transmit spam (actually I don't recall receiving any in a long while!) and (2) we can track the conversations as separate threads.

So this website automatically closes the comments on pages that are a few months old. After that, no more comments. In other words, pretty much all of the ...

The libQtCassandra library has had a bug that would create a cell when testing for its existance. This has been very annoying because I had to use a different mechanism to check whether a cell exists instead of calling the simple and effective QCassandraRow::exists() function.

The function would call the table function necessary to read the content of a cell in the Cassandra cluster. The function returns true or false. If false, the data was not retrieved and thus the cell does not exist. However, the row function was not testing the result and a couple lines below it would do a setValue() ...

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly