views:

101

answers:

3

I'm building a website that doesn't require a database because a REST API "is the database". (Except you don't want to be putting site-specific things in there, since the API is used by mostly mobile clients)

However there's a few things that normally would be put in a database, for example the "jobs" page. You have master list view, and the detail views for each job, and it should be easy to add new job entries. (not necessarily via a CMS, but that would be awesome)

e.g. example.com/careers/ and example.com/careers/77/

I could just hardcode this stuff in templates, but that's no DRY- you have to update the master template and the detail template every time.

What do you guys think? Maybe a YAML file? Or any better ideas? Thx

+5  A: 

Why not still keep it in a database? Your remote REST store is all well and funky, but if you've got local data, there's nothing (unless there's spec saying so) to stop you storing some stuff in a local db. Doesn't have to be anything v glamorous - could be sqlite, or you could have some fun with redis, etc.

stevejalim
I would like to stay away from databases if possible. Schema design, migrations, making sure all environments have the current schemas, big point of failure, sysadmin headaches, etc etc
Infinity
Django ORM makes schema design easy, and South handles migrations pretty well... the admin interface makes a decent free CRM...
Chris Lawlor
+1 for Chris L's point. And if you wanted to use redis, check out the README at http://github.com/andymccurdy/redis-py to see how simple it can be (though you won't get the easy power of the Django ORM this way)
stevejalim
+1  A: 

Some alternatives built into the Python library are listed in the Data Persistence chapter of the documentation. Still another is JSON.

Jouni K. Seppänen
+2  A: 

You could use the Memcachedb via the Django cache interface.

For example:

Set the cache backend as memcached in your django settings, but install/use memcachedb instead.

Django can't tell the difference between the two because the provide the same interface (at least last time I checked).

Memcachedb is persistent, safe for multithreaded django servers, and won't lose data during server restarts, but it's just a key value store. not a complete database.

Jiaaro