how to change sqlite database to postgres for account server and container server?

asked 2012-01-02 10:01:57 -0600

We want to use Postgres instead of sqlite for storing listing of objects and containers (on container server and account server respectively). We were looking through swift documentation but did not find relevant steps to configure this.

Can anybody help on how this can be done or point us to any relevant documentation.

Thanks in advance, Atul

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
0

answered 2012-01-04 03:37:45 -0600

Thanks Mike Barton, that solved my question.

edit flag offensive delete link more
0

answered 2012-01-02 20:02:55 -0600

redbo gravatar image

That's not a configurable option, and would require changing a decent amount of code to do.

edit flag offensive delete link more
0

answered 2012-01-03 04:45:56 -0600

Thanks Mike. I was looking through code and thought so. I have noted few files which I would probably need to change or are relevant to this like swift/common/db.py. As I'm very new to this code (and Python too :)) I would appreciate if you can help me figure out at high level which all files/modules would need changes to make this work.

I'm determined to get this done, and any help to achieve this goal faster is highly appreciated.

Thanks a lot for your support. -Atul

edit flag offensive delete link more
0

answered 2012-01-03 05:05:43 -0600

notmyname gravatar image

One of the main advantages to using sqlite3 is that each db is represented by a file in the filesystem. Many of swift's processes rely on this fact (eg replication to ensure 3 copies are made, the account and container servers on where to write and read the data, all of the auditors to do integrity checks, etc).

I think moving Mike's comment of this change requiring "changing a decent amount of code to do" may be read as "just about every major subsystem in swift would need to be changed". That's not to say it couldn't be done or wouldn't work, just that the end result would be something different than swift.

As an alternative, one could keep metadata (ie listings) client-side in Postgres. This may be useful in cases where listing order needs to be changed (swift only sorts listings by name) or when the cardinality of the listings gets large (swift returns 10K "pages"--iterating over several million or more objects gets cumbersome) or when server-side eventual consistency needs to be spoofed as fully consistent to the client.

--John

On Jan 2, 2012, at 10:50 PM, Atul wrote:

Question #183504 on OpenStack Object Storage (swift) changed: https://answers.launchpad.net/swift/+...

Status: Answered => Open

Atul is still having a problem: Thanks Mike. I was looking through code and thought so. I have noted few files which I would probably need to change or are relevant to this like swift/common/db.py. As I'm very new to this code (and Python too :)) I would appreciate if you can help me figure out at high level which all files/modules would need changes to make this work.

I'm determined to get this done, and any help to achieve this goal faster is highly appreciated.

Thanks a lot for your support. -Atul


You received this question notification because you are a member of Swift Core, which is an answer contact for OpenStack Object Storage (swift).

edit flag offensive delete link more
0

answered 2012-01-04 03:37:24 -0600

Ok. You have frightened me enough! :) Let me check the alternative suggested.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-01-02 10:01:57 -0600

Seen: 88 times

Last updated: Jan 04 '12